//#region src/helpers/array-to-path.d.ts /** * @see https://github.com/express-validator/express-validator/blob/bec1dcbaa29002dcd21093ec84818c4671063b5d/src/field-selection.ts#L214 * @param parts */ declare function arrayToPath(parts: readonly PropertyKey[]): string; //#endregion //#region src/helpers/path-to-array.d.ts declare const BRACKET_NUMBER_REGEX: RegExp; /** * Convert string to property path array. * * @see https://github.com/lodash/lodash/blob/main/src/.internal/stringToPath.ts * @see https://github.com/chaijs/pathval * * @param segment */ declare function pathToArray(segment: PropertyKey): PropertyKey[]; //#endregion //#region src/path-expand/types.d.ts type PathExpanded = { value: string; matches: readonly (string | string[])[]; }; //#endregion //#region src/path-expand/module.d.ts /** * Verbose expand wildcard and glob patterns. * Track wildcard/glob pattern matches. * * @param data * @param path */ declare function expandPathVerbose(data: Record, path: PropertyKey | PropertyKey[]): PathExpanded[]; /** * Expand wildcard and glob patterns to paths. * * @param data * @param path */ declare function expandPath(data: Record, path: PropertyKey | PropertyKey[]): string[]; //#endregion //#region src/path-value/get.d.ts declare function getPathValue(data: unknown, path: PropertyKey | PropertyKey[]): unknown; //#endregion //#region src/path-value/set.d.ts declare function setPathValue(data: Record | Record[], path: string | string[], value: unknown): Record | Record[]; //#endregion //#region src/path-info/module.d.ts declare class PathInfo { protected data: unknown; protected pathParts: PropertyKey[]; protected _value: unknown; protected _parent: PathInfo | null | undefined; protected _exists: boolean | undefined; constructor(data: unknown, path: PropertyKey | PropertyKey[]); get value(): unknown; get name(): PropertyKey | null; get parent(): PathInfo | null; get exists(): boolean; } //#endregion //#region src/path-info/helper.d.ts declare function getPathInfo(data: Record, path: PropertyKey | PropertyKey[]): PathInfo; //#endregion //#region src/remove.d.ts declare function removePath(data: Record | Record[], path: string | string[]): void; //#endregion //#region src/types.d.ts type ObjectLiteral = Record; type ToWrappedNumber = T extends `[${number}]` ? T : T extends number ? `[${T}]` : T; type PrevIndex = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; type KeyConcat = A extends number | `[${number}]` ? (B extends number | `[${number}]` ? `${ToWrappedNumber}${ToWrappedNumber}` : `${ToWrappedNumber}.${B}`) : B extends number | `[${number}]` ? `${A}${ToWrappedNumber}` : `${A}.${B}`; type EscapeKey = T extends `[${infer U}]` ? `\\[${U}\\]` : T; type Glob = '*' | '**'; type GlobNext = [Depth] extends [0] ? never : T extends `${Glob}.${infer U}` ? T | U : T; type PathNormalize = T extends `${infer A}.[${infer B}].${infer C}` ? `${A}[${B}].${C}` : T; type PathVariants = P extends string | number ? (PathNormalize | KeyConcat | KeyConcat | KeyConcat<'*', P> | KeyConcat<'**', GlobNext

>>) : never; type Path = [Depth] extends [0] ? never : T extends ObjectLiteral ? { [Key in keyof T & (string | number)]: T[Key] extends (infer U)[] ? EscapeKey | PathVariants, Path> : T[Key] extends ObjectLiteral ? EscapeKey | PathVariants, Path> : EscapeKey }[keyof T & (string | number)] : never; //#endregion export { BRACKET_NUMBER_REGEX, ObjectLiteral, Path, PathExpanded, PathInfo, arrayToPath, expandPath, expandPathVerbose, getPathInfo, getPathValue, pathToArray, removePath, setPathValue }; //# sourceMappingURL=index.d.mts.map