@sketch-hq/sketch-assistant-utils
Version:
Utility functions and types for Sketch Assistants.
13 lines • 643 B
TypeScript
import { JsonPointer } from '@sketch-hq/sketch-assistant-types';
/**
* Resolve a RFC6901 JSON Pointer to a value with a target object instance.
*/
declare const evalPointer: (pointer: string, instance: any) => unknown;
/**
* Unwind a RFC6901 JSON Pointer string one level to find the JSON Pointer for its parent,
* e.g. `/foo/bar/0/baz` => `foo/bar[0]`. If the JSON Pointer is invalid or the parent isn't
* available (i.e. already at the root) then `undefined` is returned.
*/
declare const getParentPointer: (pointer: JsonPointer) => JsonPointer | undefined;
export { evalPointer, getParentPointer };
//# sourceMappingURL=index.d.ts.map