UNPKG

@canard/schema-form

Version:

React-based component library that renders forms based on JSON Schema with plugin system support for validators and UI components

17 lines (16 loc) 615 B
/** * Checks if a JSON Pointer path is an absolute path. * @param path - The JSON Pointer path to check. * @note Use string literal type to check faster. * @warning JSON Pointer only supports absolute paths. * @returns True if the path is an absolute path, false otherwise. * * @example * isAbsolutePath('/foo/bar') // true * isAbsolutePath('#/foo/bar') // true * isAbsolutePath('./foo/bar') // false * isAbsolutePath('../foo/bar') // false * isAbsolutePath('../../foo/bar') // false * isAbsolutePath('../../foo/bar/baz') // false */ export declare const isAbsolutePath: (pointer: string) => boolean;