source: node_modules/fast-json-patch/module/helpers.d.ts

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*!
2 * https://github.com/Starcounter-Jack/JSON-Patch
3 * (c) 2017-2022 Joachim Wester
4 * MIT licensed
5 */
6export declare function hasOwnProperty(obj: any, key: any): any;
7export declare function _objectKeys(obj: any): any[];
8/**
9* Deeply clone the object.
10* https://jsperf.com/deep-copy-vs-json-stringify-json-parse/25 (recursiveDeepCopy)
11* @param {any} obj value to clone
12* @return {any} cloned obj
13*/
14export declare function _deepClone(obj: any): any;
15export declare function isInteger(str: string): boolean;
16/**
17* Escapes a json pointer path
18* @param path The raw pointer
19* @return the Escaped path
20*/
21export declare function escapePathComponent(path: string): string;
22/**
23 * Unescapes a json pointer path
24 * @param path The escaped pointer
25 * @return The unescaped path
26 */
27export declare function unescapePathComponent(path: string): string;
28export declare function _getPathRecursive(root: Object, obj: Object): string;
29export declare function getPath(root: Object, obj: Object): string;
30/**
31* Recursively checks whether an object has any undefined values inside.
32*/
33export declare function hasUndefined(obj: any): boolean;
34export declare type JsonPatchErrorName = 'SEQUENCE_NOT_AN_ARRAY' | 'OPERATION_NOT_AN_OBJECT' | 'OPERATION_OP_INVALID' | 'OPERATION_PATH_INVALID' | 'OPERATION_FROM_REQUIRED' | 'OPERATION_VALUE_REQUIRED' | 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED' | 'OPERATION_PATH_CANNOT_ADD' | 'OPERATION_PATH_UNRESOLVABLE' | 'OPERATION_FROM_UNRESOLVABLE' | 'OPERATION_PATH_ILLEGAL_ARRAY_INDEX' | 'OPERATION_VALUE_OUT_OF_BOUNDS' | 'TEST_OPERATION_FAILED';
35export declare class PatchError extends Error {
36 name: JsonPatchErrorName;
37 index?: number;
38 operation?: any;
39 tree?: any;
40 constructor(message: string, name: JsonPatchErrorName, index?: number, operation?: any, tree?: any);
41}
Note: See TracBrowser for help on using the repository browser.