botbook/node_modules/@sagold/json-pointer/dist/lib/join.d.ts
Rodrigo Rodriguez 6ae15fe3e5 Updated.
2024-09-04 13:13:15 -03:00

22 lines
782 B
TypeScript

import { JsonPointer, JsonPath } from "./types";
/**
* Convert a list of JsonPointers, or a single JsonPath to a valid json-pointer
*
* Supports as input:
* - a json-path
* - a list of json-pointers
* - relative json-pointers
*
* If the last parameter is a boolean and set to true, a URIFragment is
* returned (leading `#/`)
*
* # examples
*
* `join(["metadata", "title"])` // "metadata/title"
* `join(["metadata", "title"], true)` // "#/metadata/title"
* `join("metadata", "title")` // "metadata/title"
* `join("#/metadata", "title")` // "#/metadata/title"
* `join("metadata", "title", true)` // "#/metadata/title"
* `join("metadata", "../title")` // "title"
*/
export declare function join(firstPointer: JsonPointer | JsonPath, ...args: any[]): JsonPointer;