UNPKG

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).

13 lines (12 loc) 1.08 kB
import findIndex from 'lodash/findIndex.js'; export declare function createSameElementsArray<const ElementType>(length: number, elementValue: ElementType): ElementType[]; export declare function splitArray<const ElementType>(array: ElementType[], predicate: (element: ElementType) => boolean, options?: { includeSplitterElement?: 'prefix' | 'suffix' | null | undefined; }): ElementType[][]; export declare function getElementsBetween<ElementType>(array: ElementType[], startPredicate: Parameters<typeof findIndex>[1], endPredicate: Parameters<typeof findIndex>[1]): ElementType[][]; export declare function forEachInRange<ElementType>(array: ElementType[], { start, end, step, }: { start?: number | undefined; end?: number | undefined; step?: number | undefined; }, callbackFn: (element: ElementType, index: number, array: ElementType[]) => void): void; export declare function forEachElementCombination<ElementType>(array: ElementType[], callbackFn: (elementA: ElementType, elementB: ElementType, indexA: number, indexB: number, array: ElementType[]) => void): void;