UNPKG

typescript-scaffolder

Version:

![npm version](https://img.shields.io/npm/v/typescript-scaffolder) ![coverage](https://img.shields.io/badge/coverage-97.38%25-green)

46 lines 1.6 kB
/** * Checks an object to see if all required fields are present * @param obj * @param required */ export declare function assertRequiredFields(obj: Record<string, any>, required: string[]): void; /** * Checks an object to see if the structure is correct to what is expected * @param obj * @param structure */ export declare function assertStructure(obj: any, structure: Record<string, string>): void; /** * Checks to see if there are any duplicate keys within the JSON * @param jsonString */ export declare function assertNoDuplicateKeys(jsonString: string, filename: string): void; /** * Checks to see if all values within an enum are valid * @param field * @param value * @param allowed */ export declare function assertEnumValue(field: string, value: any, allowed: any[]): void; /** * Checks to see whether the value declared in a spec is within the min and max range * @param field * @param value * @param min * @param max */ export declare function assertInRange(field: string, value: any, min: number, max: number): void; /** * Validates a top-level sequences array, if present. * @param config The full parsed configuration object */ export declare function assertSequences(config: any): void; /** * Validates a single sequence object. * Ensures required fields and step-array structure before recursing. * @param seq The sequence object to validate */ export declare function assertSequence(seq: any): void; /** Validate a single step based on its type */ export declare function assertSequenceStep(step: any): void; //# sourceMappingURL=structure-validators.d.ts.map