schema-fun
Version:
JSON schema tools
21 lines • 1.18 kB
TypeScript
export type PropertyPathStr = string;
export type PropertyPathArray = (string | number)[];
export type PropertyPath = PropertyPathStr | PropertyPathArray;
export type JsonPathStr = string;
export type JsonPointerStr = string;
export type PathTransformer = (path: string) => {
path: string;
additionalOptions?: {
[key: string]: any;
};
};
export declare function jsonPathToPropertyPath(jsonPath: string): string;
export declare function dottedPathToArray(path: PropertyPathStr): PropertyPathArray;
export declare function pathDepth(path: PropertyPath): number;
export declare function arrayToDottedPath(pathArray: PropertyPathArray): PropertyPathStr;
export declare function propertyPathToArray(path: PropertyPath): PropertyPathArray;
export declare function propertyPathToDottedPath(path: PropertyPath): PropertyPathStr;
export declare function shortenPath(path: PropertyPathStr, numComponentsToTrim: number): PropertyPathStr;
export declare function tailPath(path: PropertyPathStr, numComponentsToTrim: number): PropertyPathStr;
export declare function mapPaths<T>(x: T, transformPath: PathTransformer, visited?: any[]): T;
//# sourceMappingURL=paths.d.ts.map