json-schema-describes-subset
Version:
Tools for static JSON schema analysis, including functions to determine if one schema describes a subset of another or if a schema describes the empty set or to convert a schema to its disjunctive normal form (DNF).
12 lines (11 loc) • 626 B
TypeScript
export declare const allJSONSchemaTypes: ["null", "number", "string", "boolean", "array", "object"];
export type AllJSONSchemaTypes = typeof allJSONSchemaTypes;
export type JSONSchemaType = AllJSONSchemaTypes[number];
export declare function isJSONSchemaType(value: unknown): value is JSONSchemaType;
/**
* Returns an array of the provided elements that are {@link JSONSchemaType}s.
* The elements of the returned array are unique.
*
*/
export declare function filterJSONSchemaTypes(strings: string[]): JSONSchemaType[];
export declare function getOtherJSONSchemaTypes(types: readonly JSONSchemaType[]): JSONSchemaType[];