json-p3 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/json-p3.browser.js +4 -4
- package/dist/json-p3.browser.min.js +1 -1
- package/dist/json-p3.browser.min.js.map +1 -1
- package/dist/json-p3.cjs.js +4 -4
- package/dist/json-p3.esm.js +4 -4
- package/dist/json-p3.iife.min.js +1 -1
- package/dist/json-p3.iife.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/deep_equals.d.ts +0 -10
- package/dist/index.d.ts +0 -10
- package/dist/patch/errors.d.ts +0 -11
- package/dist/patch/index.d.ts +0 -11
- package/dist/patch/patch.d.ts +0 -161
- package/dist/path/environment.d.ts +0 -165
- package/dist/path/errors.d.ts +0 -65
- package/dist/path/expression.d.ts +0 -101
- package/dist/path/extra/expression.d.ts +0 -6
- package/dist/path/extra/index.d.ts +0 -0
- package/dist/path/extra/selectors.d.ts +0 -35
- package/dist/path/functions/count.d.ts +0 -7
- package/dist/path/functions/function.d.ts +0 -26
- package/dist/path/functions/has.d.ts +0 -44
- package/dist/path/functions/index.d.ts +0 -11
- package/dist/path/functions/length.d.ts +0 -7
- package/dist/path/functions/match.d.ts +0 -33
- package/dist/path/functions/pattern.d.ts +0 -2
- package/dist/path/functions/search.d.ts +0 -34
- package/dist/path/functions/value.d.ts +0 -7
- package/dist/path/index.d.ts +0 -76
- package/dist/path/lex.d.ts +0 -74
- package/dist/path/lru_cache.d.ts +0 -10
- package/dist/path/node.d.ts +0 -84
- package/dist/path/parse.d.ts +0 -61
- package/dist/path/path.d.ts +0 -42
- package/dist/path/selectors.d.ts +0 -86
- package/dist/path/serialize.d.ts +0 -6
- package/dist/path/token.d.ts +0 -70
- package/dist/path/types.d.ts +0 -46
- package/dist/pointer/errors.d.ts +0 -42
- package/dist/pointer/index.d.ts +0 -24
- package/dist/pointer/pointer.d.ts +0 -106
- package/dist/types.d.ts +0 -25
package/dist/pointer/errors.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base class for all JSON Pointer errors.
|
|
3
|
-
*/
|
|
4
|
-
export declare class JSONPointerError extends Error {
|
|
5
|
-
readonly message: string;
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Base class for JSON Pointer resolution errors.
|
|
10
|
-
*/
|
|
11
|
-
export declare class JSONPointerResolutionError extends JSONPointerError {
|
|
12
|
-
readonly message: string;
|
|
13
|
-
constructor(message: string);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Error thrown due to an out of range index when resolving a JSON Pointer.
|
|
17
|
-
*/
|
|
18
|
-
export declare class JSONPointerIndexError extends JSONPointerResolutionError {
|
|
19
|
-
readonly message: string;
|
|
20
|
-
constructor(message: string);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Error thrown due to a missing property when resolving a JSON Pointer.
|
|
24
|
-
*/
|
|
25
|
-
export declare class JSONPointerKeyError extends JSONPointerResolutionError {
|
|
26
|
-
readonly message: string;
|
|
27
|
-
constructor(message: string);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Error thrown due to invalid JSON Pointer syntax.
|
|
31
|
-
*/
|
|
32
|
-
export declare class JSONPointerSyntaxError extends JSONPointerError {
|
|
33
|
-
readonly message: string;
|
|
34
|
-
constructor(message: string);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Error thrown when trying to resolve a property or index against a primitive value.
|
|
38
|
-
*/
|
|
39
|
-
export declare class JSONPointerTypeError extends JSONPointerResolutionError {
|
|
40
|
-
readonly message: string;
|
|
41
|
-
constructor(message: string);
|
|
42
|
-
}
|
package/dist/pointer/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { JSONValue } from "../types";
|
|
2
|
-
import { MaybeJSONValue } from "./pointer";
|
|
3
|
-
export { JSONPointer, RelativeJSONPointer, UNDEFINED } from "./pointer";
|
|
4
|
-
export type { MaybeJSONValue } from "./pointer";
|
|
5
|
-
export { JSONPointerError, JSONPointerResolutionError, JSONPointerIndexError, JSONPointerKeyError, JSONPointerSyntaxError, JSONPointerTypeError, } from "./errors";
|
|
6
|
-
/**
|
|
7
|
-
* Resolve JSON Pointer _pointer_ against JSON-like data _value_.
|
|
8
|
-
*
|
|
9
|
-
* @param pointer - A string representation of a JSON pointer.
|
|
10
|
-
* @param value - The target JSON-like value, possibly loaded using
|
|
11
|
-
* `JSON.parse()`.
|
|
12
|
-
* @param fallback - A default value to return if _value_ has no
|
|
13
|
-
* path matching `pointer`.
|
|
14
|
-
* @returns The value identified by _pointer_ or, if given, the fallback
|
|
15
|
-
* value in the even of a `JSONPointerResolutionError`.
|
|
16
|
-
*
|
|
17
|
-
* @throws {@link JSONPointerResolutionError}
|
|
18
|
-
* If the value pointed to by _pointer_ does not exist in _value_, and
|
|
19
|
-
* no fallback value is given.
|
|
20
|
-
*
|
|
21
|
-
* @throws {@link JSONPointerSyntaxError}
|
|
22
|
-
* If _pointer_ is malformed according to RFC 6901.
|
|
23
|
-
*/
|
|
24
|
-
export declare function resolve(pointer: string, value: JSONValue, fallback?: MaybeJSONValue): JSONValue;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { JSONValue } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* The symbol indicating the absence of a JSON value.
|
|
4
|
-
*/
|
|
5
|
-
export declare const UNDEFINED: unique symbol;
|
|
6
|
-
export type MaybeJSONValue = JSONValue | typeof UNDEFINED;
|
|
7
|
-
/**
|
|
8
|
-
* Identify a single value in JSON-like data, as per RFC 6901.
|
|
9
|
-
*/
|
|
10
|
-
export declare class JSONPointer {
|
|
11
|
-
#private;
|
|
12
|
-
tokens: string[];
|
|
13
|
-
/**
|
|
14
|
-
* @param pointer - A string representation of a JSON Pointer.
|
|
15
|
-
*/
|
|
16
|
-
constructor(pointer: string);
|
|
17
|
-
static encode(tokens: string[]): string;
|
|
18
|
-
/**
|
|
19
|
-
* Resolve this pointer against JSON-like data _value_.
|
|
20
|
-
*
|
|
21
|
-
* @param value - The target JSON-like value, possibly loaded using
|
|
22
|
-
* `JSON.parse()`.
|
|
23
|
-
* @param fallback - A default value to return if _value_ has no
|
|
24
|
-
* path matching `pointer`.
|
|
25
|
-
* @returns The value identified by _pointer_ or, if given, the fallback
|
|
26
|
-
* value in the even of a `JSONPointerResolutionError`.
|
|
27
|
-
*
|
|
28
|
-
* @throws {@link JSONPointerResolutionError}
|
|
29
|
-
* If the value pointed to by _pointer_ does not exist in _value_, and
|
|
30
|
-
* no fallback value is given.
|
|
31
|
-
*/
|
|
32
|
-
resolve(value: JSONValue, fallback?: MaybeJSONValue): JSONValue;
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param value -
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
resolveWithParent(value: JSONValue): [MaybeJSONValue, MaybeJSONValue];
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
toString(): string;
|
|
44
|
-
/**
|
|
45
|
-
* Return _true_ if this pointer points to a child of _pointer_.
|
|
46
|
-
*/
|
|
47
|
-
isRelativeTo(pointer: JSONPointer): boolean;
|
|
48
|
-
protected parse(pointer: string): string[];
|
|
49
|
-
protected getItem(val: JSONValue, token: string, idx: number): JSONValue;
|
|
50
|
-
private _join;
|
|
51
|
-
/**
|
|
52
|
-
* Join this pointer with _tokens_.
|
|
53
|
-
*
|
|
54
|
-
* @param tokens - JSON Pointer strings, possibly without leading slashes.
|
|
55
|
-
* If a token or "part" does have a leading slash, the previous pointer is
|
|
56
|
-
* ignored and a new `JSONPointer` is created, then processing of the
|
|
57
|
-
* remaining tokens continues.
|
|
58
|
-
*
|
|
59
|
-
* @returns A new JSON Pointer that is the concatenation of all tokens or
|
|
60
|
-
* "parts".
|
|
61
|
-
*/
|
|
62
|
-
join(...tokens: string[]): JSONPointer;
|
|
63
|
-
/**
|
|
64
|
-
* Return _true_ if this pointer can be resolved against _value_.
|
|
65
|
-
*
|
|
66
|
-
* Note that `JSONPointer.resolve()` can return legitimate falsy values
|
|
67
|
-
* that form part of the target JSON document. This method will return
|
|
68
|
-
* `true` if a falsy value is found.
|
|
69
|
-
*/
|
|
70
|
-
exists(value: JSONValue): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Return this pointer's parent as a new `JSONPointer`.
|
|
73
|
-
*
|
|
74
|
-
* If this pointer points to the document root, _this_ is returned.
|
|
75
|
-
*/
|
|
76
|
-
parent(): JSONPointer;
|
|
77
|
-
to(rel: string | RelativeJSONPointer): JSONPointer;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* A relative JSON Pointer.
|
|
81
|
-
*
|
|
82
|
-
* See https://datatracker.ietf.org/doc/html/draft-hha-relative-json-pointer
|
|
83
|
-
*/
|
|
84
|
-
export declare class RelativeJSONPointer {
|
|
85
|
-
readonly origin: number;
|
|
86
|
-
readonly index: number;
|
|
87
|
-
readonly pointer: string | JSONPointer;
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
* @param rel -
|
|
91
|
-
*/
|
|
92
|
-
constructor(rel: string);
|
|
93
|
-
/**
|
|
94
|
-
*
|
|
95
|
-
* @returns
|
|
96
|
-
*/
|
|
97
|
-
toString(): string;
|
|
98
|
-
/**
|
|
99
|
-
*
|
|
100
|
-
* @param pointer -
|
|
101
|
-
*/
|
|
102
|
-
to(pointer: string | JSONPointer): JSONPointer;
|
|
103
|
-
protected parse(rel: string): [number, number, string | JSONPointer];
|
|
104
|
-
protected parseInt(s: string): number;
|
|
105
|
-
protected isIntLike(value: string | number | undefined): boolean;
|
|
106
|
-
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common types and type predicates.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* A JSON-like value.
|
|
6
|
-
*/
|
|
7
|
-
export type JSONValue = string | number | null | undefined | boolean | JSONValue[] | {
|
|
8
|
-
[key: string]: JSONValue;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* A type predicate for the Array object.
|
|
12
|
-
*/
|
|
13
|
-
export declare function isArray(value: unknown): value is unknown[];
|
|
14
|
-
/**
|
|
15
|
-
* A type predicate for object.
|
|
16
|
-
*/
|
|
17
|
-
export declare function isObject(value: unknown): value is object;
|
|
18
|
-
/**
|
|
19
|
-
* A type predicate for a string primitive.
|
|
20
|
-
*/
|
|
21
|
-
export declare function isString(value: unknown): value is string;
|
|
22
|
-
/**
|
|
23
|
-
* A type predicate for a number primitive.
|
|
24
|
-
*/
|
|
25
|
-
export declare function isNumber(value: unknown): value is number;
|