Files
notification-elements-demo/node_modules/@jsonjoy.com/json-pointer/lib/util.d.ts
Giuliano Silvestro 5d0c9ec7eb Initial commit: notification-elements-demo app
Interactive Angular 19 demo for @sda/notification-elements-ui with
6 sections: Bell & Feed, Notification Center, Inbox, Comments &
Threads, Mention Input, and Full-Featured layout. Includes mock
data, dark mode toggle, and real-time event log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:49:19 +10:00

39 lines
1.3 KiB
TypeScript

import type { Path } from './types';
/**
* Un-escapes a JSON pointer path component.
*/
export declare function unescapeComponent(component: string): string;
/**
* Escapes a JSON pointer path component.
*/
export declare function escapeComponent(component: string): string;
/**
* Convert JSON pointer like "/foo/bar" to array like ["", "foo", "bar"], while
* also un-escaping reserved characters.
*/
export declare function parseJsonPointer(pointer: string): Path;
/**
* Escape and format a path array like ["", "foo", "bar"] to JSON pointer
* like "/foo/bar".
*/
export declare function formatJsonPointer(path: Path): string;
export declare const toPath: (pointer: string | Path) => Path;
/**
* Returns true if `parent` contains `child` path, false otherwise.
*/
export declare function isChild(parent: Path, child: Path): boolean;
export declare function isPathEqual(p1: Path, p2: Path): boolean;
/**
* Returns true if JSON Pointer points to root value, false otherwise.
*/
export declare const isRoot: (path: Path) => boolean;
/**
* Returns parent path, e.g. for ['foo', 'bar', 'baz'] returns ['foo', 'bar'].
*/
export declare function parent(path: Path): Path;
/**
* Check if path component can be a valid array index.
*/
export declare function isValidIndex(index: string | number): boolean;
export declare const isInteger: (str: string) => boolean;