json10 13.1.44 → 16.0.46
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/assets/shared/shared_folder_info.txt +1 -1
- package/browser/{esm2020 → esm2022}/json10.mjs +4 -4
- package/{client/esm2020 → browser/esm2022}/lib/index.mjs +53 -53
- package/browser/{esm2020 → esm2022}/public-api.mjs +1 -1
- package/{client/fesm2015 → browser/fesm2022}/json10.mjs +51 -51
- package/browser/{json10.d.ts → index.d.ts} +4 -4
- package/browser/lib/index.d.ts +14 -14
- package/browser/package.json +6 -12
- package/client/{esm2020 → esm2022}/json10.mjs +4 -4
- package/{browser/esm2020 → client/esm2022}/lib/index.mjs +53 -53
- package/client/{esm2020 → esm2022}/public-api.mjs +1 -1
- package/{browser/fesm2020 → client/fesm2022}/json10.mjs +51 -51
- package/client/{json10.d.ts → index.d.ts} +4 -4
- package/client/lib/index.d.ts +14 -14
- package/client/package.json +89 -85
- package/index.d.ts +1 -1
- package/lib/index.d.ts +15 -15
- package/package.json +3 -3
- package/package.json_tnp.json5 +1 -1
- package/tmp-environment.json +94 -90
- package/websql/{esm2020 → esm2022}/json10.mjs +4 -4
- package/websql/{esm2020 → esm2022}/lib/index.mjs +53 -53
- package/websql/{esm2020 → esm2022}/public-api.mjs +1 -1
- package/websql/{fesm2015 → fesm2022}/json10.mjs +51 -51
- package/websql/{json10.d.ts → index.d.ts} +4 -4
- package/websql/lib/index.d.ts +14 -14
- package/websql/package.json +6 -12
- package/browser/fesm2015/json10.mjs +0 -61
- package/client/fesm2015/json10.mjs.map +0 -1
- package/client/fesm2020/json10.mjs +0 -61
- package/client/fesm2020/json10.mjs.map +0 -1
- package/websql/fesm2020/json10.mjs +0 -61
- package/websql/fesm2020/json10.mjs.map +0 -1
- /package/browser/{fesm2015 → fesm2022}/json10.mjs.map +0 -0
- /package/{browser/fesm2020 → client/fesm2022}/json10.mjs.map +0 -0
- /package/websql/{fesm2015 → fesm2022}/json10.mjs.map +0 -0
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { _ } from 'tnp-core/browser';
|
|
2
|
-
import { walk } from 'lodash-walk-object/browser';
|
|
3
|
-
import { CLASS } from 'typescript-class-helpers/browser';
|
|
4
|
-
|
|
5
|
-
class JSON10 {
|
|
6
|
-
static structureArray(anyJSON, options) {
|
|
7
|
-
let pathes = [];
|
|
8
|
-
const { include, exclude } = options || {};
|
|
9
|
-
walk.Object(anyJSON, (value, lodashPath) => {
|
|
10
|
-
if (!_.isUndefined(value)) {
|
|
11
|
-
pathes.push(lodashPath);
|
|
12
|
-
}
|
|
13
|
-
}, { include, exclude, checkCircural: true });
|
|
14
|
-
return pathes;
|
|
15
|
-
}
|
|
16
|
-
static cleaned(json, onCircs, options) {
|
|
17
|
-
const result = _.isArray(json) ? [] : {};
|
|
18
|
-
const classFN = CLASS.OBJECT(json).isClassObject && CLASS.getFromObject(json);
|
|
19
|
-
const { exclude, include, breadthWalk } = options || { exclude: [], include: [], breadthWalk: false };
|
|
20
|
-
const { circs } = walk.Object(json, (value, lodashPath, changeValueTo, options) => {
|
|
21
|
-
if (_.isObject(value) && options.isCircural) {
|
|
22
|
-
_.set(result, lodashPath, null);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
_.set(result, lodashPath, _.cloneDeep(value));
|
|
26
|
-
}
|
|
27
|
-
}, { include, exclude, breadthWalk, checkCircural: true });
|
|
28
|
-
if (_.isFunction(onCircs)) {
|
|
29
|
-
onCircs(circs);
|
|
30
|
-
}
|
|
31
|
-
return _.isFunction(classFN) ? _.merge(new classFN(), result) : result;
|
|
32
|
-
}
|
|
33
|
-
static stringify(anyJSON, replace, spaces, onCircs) {
|
|
34
|
-
const json = this.cleaned(anyJSON, onCircs);
|
|
35
|
-
return JSON.stringify(json, replace, spaces);
|
|
36
|
-
}
|
|
37
|
-
static parse(json, circs = []) {
|
|
38
|
-
let res = JSON.parse(json);
|
|
39
|
-
if (_.isArray(circs)) {
|
|
40
|
-
circs.forEach(({ circuralTargetPath, pathToObj }) => {
|
|
41
|
-
if (circuralTargetPath === '') {
|
|
42
|
-
_.set(res, pathToObj, res);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
let v = _.get(res, circuralTargetPath);
|
|
46
|
-
_.set(res, pathToObj, v);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return res;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
;
|
|
54
|
-
({}); // @--end-of-file-for-module=json10 lib/index.ts
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Generated bundle index. Do not edit.
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
export { JSON10 };
|
|
61
|
-
//# sourceMappingURL=json10.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json10.mjs","sources":["../../../tmp-libs-for-bundle/json10/projects/json10/src/lib/index.ts","../../../tmp-libs-for-bundle/json10/projects/json10/src/json10.ts"],"sourcesContent":["import { _ } from 'tnp-core/browser';\nimport { walk, Models } from 'lodash-walk-object/browser';\nexport type Circ = Models.Circ;\nimport { CLASS } from 'typescript-class-helpers/browser';\n\n\n\n\n\nexport class JSON10 {\n\n public static structureArray(anyJSON: Object, options?: { include?: string[]; exclude?: string[] }) {\n let pathes = []\n const { include, exclude } = options || {} as any;\n walk.Object(anyJSON, (value, lodashPath) => {\n\n if (!_.isUndefined(value)) {\n pathes.push(lodashPath)\n }\n\n }, { include, exclude, checkCircural: true })\n return pathes;\n }\n\n\n public static cleaned(json, onCircs?: (circs: Circ[]) => any, options?:\n {\n exclude?: string[];\n include?: string[];\n breadthWalk?: boolean;\n }) {\n\n const result = _.isArray(json) ? [] : {}\n const classFN = CLASS.OBJECT(json).isClassObject && CLASS.getFromObject(json);\n\n const { exclude, include, breadthWalk } = options || { exclude: [], include: [], breadthWalk: false };\n\n const { circs } = walk.Object(json, (value, lodashPath, changeValueTo, options) => {\n\n if (_.isObject(value) && options.isCircural) {\n _.set(result, lodashPath, null)\n } else {\n _.set(result, lodashPath, _.cloneDeep(value))\n }\n\n }, { include, exclude, breadthWalk, checkCircural: true });\n\n if (_.isFunction(onCircs)) {\n onCircs(circs)\n }\n\n return _.isFunction(classFN) ? _.merge(new (classFN as any)(), result) : result;\n }\n\n public static stringify(anyJSON: Object, replace?: any, spaces?: number, onCircs?: (circs: Circ[]) => any) {\n const json = this.cleaned(anyJSON, onCircs);\n return JSON.stringify(json, replace, spaces);\n }\n\n public static parse(json: string, circs: Circ[] = []) {\n let res = JSON.parse(json);\n if (_.isArray(circs)) {\n circs.forEach(({ circuralTargetPath, pathToObj }) => {\n\n if (circuralTargetPath === '') {\n _.set(res, pathToObj, res)\n } else {\n let v = _.get(res, circuralTargetPath);\n _.set(res, pathToObj, v)\n }\n\n })\n }\n return res;\n }\n}\n\n ;({}); // @--end-of-file-for-module=json10 lib/index.ts","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MASa,MAAM,CAAA;AAEV,IAAA,OAAO,cAAc,CAAC,OAAe,EAAE,OAAoD,EAAA;QAChG,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,IAAI,EAAS,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAI;AAEzC,YAAA,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;AACzB,gBAAA,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACxB,aAAA;SAEF,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;AAC7C,QAAA,OAAO,MAAM,CAAC;KACf;AAGM,IAAA,OAAO,OAAO,CAAC,IAAI,EAAE,OAAgC,EAAE,OAK3D,EAAA;AAED,QAAA,MAAM,MAAM,GA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I,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;KAC9C;AAEM,IAAA,OAAO,KAAK,CAAC,IAAY,EAAE,QAAgB,EAAE,EAAA;QAClD,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC3B,QAAA,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACpB,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAI;gBAElD,IAAI,kBAAkB,KAAK,EAAE,EAAE;oBAC7B,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,CAAA;AAC3B,iBAAA;AAAM,qBAAA;oBACL,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;oBACvC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;AACzB,iBAAA;AAEH,aAAC,CAAC,CAAA;AACH,SAAA;AACD,QAAA,OAAO,GAAG,CAAC;KACZ;AACF,CAAA;AAEA,CAAC;AAAA,CAAC,EAAE,EAAE;;AC7EP;;AAEG;;;;"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { _ } from 'tnp-core/browser';
|
|
2
|
-
import { walk } from 'lodash-walk-object/browser';
|
|
3
|
-
import { CLASS } from 'typescript-class-helpers/browser';
|
|
4
|
-
|
|
5
|
-
class JSON10 {
|
|
6
|
-
static structureArray(anyJSON, options) {
|
|
7
|
-
let pathes = [];
|
|
8
|
-
const { include, exclude } = options || {};
|
|
9
|
-
walk.Object(anyJSON, (value, lodashPath) => {
|
|
10
|
-
if (!_.isUndefined(value)) {
|
|
11
|
-
pathes.push(lodashPath);
|
|
12
|
-
}
|
|
13
|
-
}, { include, exclude, checkCircural: true });
|
|
14
|
-
return pathes;
|
|
15
|
-
}
|
|
16
|
-
static cleaned(json, onCircs, options) {
|
|
17
|
-
const result = _.isArray(json) ? [] : {};
|
|
18
|
-
const classFN = CLASS.OBJECT(json).isClassObject && CLASS.getFromObject(json);
|
|
19
|
-
const { exclude, include, breadthWalk } = options || { exclude: [], include: [], breadthWalk: false };
|
|
20
|
-
const { circs } = walk.Object(json, (value, lodashPath, changeValueTo, options) => {
|
|
21
|
-
if (_.isObject(value) && options.isCircural) {
|
|
22
|
-
_.set(result, lodashPath, null);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
_.set(result, lodashPath, _.cloneDeep(value));
|
|
26
|
-
}
|
|
27
|
-
}, { include, exclude, breadthWalk, checkCircural: true });
|
|
28
|
-
if (_.isFunction(onCircs)) {
|
|
29
|
-
onCircs(circs);
|
|
30
|
-
}
|
|
31
|
-
return _.isFunction(classFN) ? _.merge(new classFN(), result) : result;
|
|
32
|
-
}
|
|
33
|
-
static stringify(anyJSON, replace, spaces, onCircs) {
|
|
34
|
-
const json = this.cleaned(anyJSON, onCircs);
|
|
35
|
-
return JSON.stringify(json, replace, spaces);
|
|
36
|
-
}
|
|
37
|
-
static parse(json, circs = []) {
|
|
38
|
-
let res = JSON.parse(json);
|
|
39
|
-
if (_.isArray(circs)) {
|
|
40
|
-
circs.forEach(({ circuralTargetPath, pathToObj }) => {
|
|
41
|
-
if (circuralTargetPath === '') {
|
|
42
|
-
_.set(res, pathToObj, res);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
let v = _.get(res, circuralTargetPath);
|
|
46
|
-
_.set(res, pathToObj, v);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return res;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
;
|
|
54
|
-
({}); // @--end-of-file-for-module=json10 lib/index.ts
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Generated bundle index. Do not edit.
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
export { JSON10 };
|
|
61
|
-
//# sourceMappingURL=json10.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json10.mjs","sources":["../../../tmp-libs-for-bundle/json10/projects/json10/src/lib/index.ts","../../../tmp-libs-for-bundle/json10/projects/json10/src/json10.ts"],"sourcesContent":["import { _ } from 'tnp-core/browser';\nimport { walk, Models } from 'lodash-walk-object/browser';\nexport type Circ = Models.Circ;\nimport { CLASS } from 'typescript-class-helpers/browser';\n\n\n\n\n\nexport class JSON10 {\n\n public static structureArray(anyJSON: Object, options?: { include?: string[]; exclude?: string[] }) {\n let pathes = []\n const { include, exclude } = options || {} as any;\n walk.Object(anyJSON, (value, lodashPath) => {\n\n if (!_.isUndefined(value)) {\n pathes.push(lodashPath)\n }\n\n }, { include, exclude, checkCircural: true })\n return pathes;\n }\n\n\n public static cleaned(json, onCircs?: (circs: Circ[]) => any, options?:\n {\n exclude?: string[];\n include?: string[];\n breadthWalk?: boolean;\n }) {\n\n const result = _.isArray(json) ? [] : {}\n const classFN = CLASS.OBJECT(json).isClassObject && CLASS.getFromObject(json);\n\n const { exclude, include, breadthWalk } = options || { exclude: [], include: [], breadthWalk: false };\n\n const { circs } = walk.Object(json, (value, lodashPath, changeValueTo, options) => {\n\n if (_.isObject(value) && options.isCircural) {\n _.set(result, lodashPath, null)\n } else {\n _.set(result, lodashPath, _.cloneDeep(value))\n }\n\n }, { include, exclude, breadthWalk, checkCircural: true });\n\n if (_.isFunction(onCircs)) {\n onCircs(circs)\n }\n\n return _.isFunction(classFN) ? _.merge(new (classFN as any)(), result) : result;\n }\n\n public static stringify(anyJSON: Object, replace?: any, spaces?: number, onCircs?: (circs: Circ[]) => any) {\n const json = this.cleaned(anyJSON, onCircs);\n return JSON.stringify(json, replace, spaces);\n }\n\n public static parse(json: string, circs: Circ[] = []) {\n let res = JSON.parse(json);\n if (_.isArray(circs)) {\n circs.forEach(({ circuralTargetPath, pathToObj }) => {\n\n if (circuralTargetPath === '') {\n _.set(res, pathToObj, res)\n } else {\n let v = _.get(res, circuralTargetPath);\n _.set(res, pathToObj, v)\n }\n\n })\n }\n return res;\n }\n}\n\n ;({}); // @--end-of-file-for-module=json10 lib/index.ts","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MASa,MAAM,CAAA;AAEV,IAAA,OAAO,cAAc,CAAC,OAAe,EAAE,OAAoD,EAAA;QAChG,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,IAAI,EAAS,CAAC;QAClD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAI;AAEzC,YAAA,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE;AACzB,gBAAA,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACxB,aAAA;SAEF,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;AAC7C,QAAA,OAAO,MAAM,CAAC;KACf;AAGM,IAAA,OAAO,OAAO,CAAC,IAAI,EAAE,OAAgC,EAAE,OAK3D,EAAA;AAED,QAAA,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAA;AACxC,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,aAAa,IAAI,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAE9E,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AAEtG,QAAA,MAAM,EAAE,KAAK,EAAE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AAE,KAAI;gBAElD,IAAI,kBAAkB,KAAK,EAAE,EAAE;oBAC7B,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,CAAA;AAC3B,iBAAA;AAAM,qBAAA;oBACL,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;oBACvC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAA;AACzB,iBAAA;AAEH,aAAC,CAAC,CAAA;AACH,SAAA;AACD,QAAA,OAAO,GAAG,CAAC;KACZ;AACF,CAAA;AAEA,CAAC;AAAA,CAAC,EAAE,EAAE;;AC7EP;;AAEG;;;;"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { _ } from 'tnp-core/websql';
|
|
2
|
-
import { walk } from 'lodash-walk-object/websql';
|
|
3
|
-
import { CLASS } from 'typescript-class-helpers/websql';
|
|
4
|
-
|
|
5
|
-
class JSON10 {
|
|
6
|
-
static structureArray(anyJSON, options) {
|
|
7
|
-
let pathes = [];
|
|
8
|
-
const { include, exclude } = options || {};
|
|
9
|
-
walk.Object(anyJSON, (value, lodashPath) => {
|
|
10
|
-
if (!_.isUndefined(value)) {
|
|
11
|
-
pathes.push(lodashPath);
|
|
12
|
-
}
|
|
13
|
-
}, { include, exclude, checkCircural: true });
|
|
14
|
-
return pathes;
|
|
15
|
-
}
|
|
16
|
-
static cleaned(json, onCircs, options) {
|
|
17
|
-
const result = _.isArray(json) ? [] : {};
|
|
18
|
-
const classFN = CLASS.OBJECT(json).isClassObject && CLASS.getFromObject(json);
|
|
19
|
-
const { exclude, include, breadthWalk } = options || { exclude: [], include: [], breadthWalk: false };
|
|
20
|
-
const { circs } = walk.Object(json, (value, lodashPath, changeValueTo, options) => {
|
|
21
|
-
if (_.isObject(value) && options.isCircural) {
|
|
22
|
-
_.set(result, lodashPath, null);
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
_.set(result, lodashPath, _.cloneDeep(value));
|
|
26
|
-
}
|
|
27
|
-
}, { include, exclude, breadthWalk, checkCircural: true });
|
|
28
|
-
if (_.isFunction(onCircs)) {
|
|
29
|
-
onCircs(circs);
|
|
30
|
-
}
|
|
31
|
-
return _.isFunction(classFN) ? _.merge(new classFN(), result) : result;
|
|
32
|
-
}
|
|
33
|
-
static stringify(anyJSON, replace, spaces, onCircs) {
|
|
34
|
-
const json = this.cleaned(anyJSON, onCircs);
|
|
35
|
-
return JSON.stringify(json, replace, spaces);
|
|
36
|
-
}
|
|
37
|
-
static parse(json, circs = []) {
|
|
38
|
-
let res = JSON.parse(json);
|
|
39
|
-
if (_.isArray(circs)) {
|
|
40
|
-
circs.forEach(({ circuralTargetPath, pathToObj }) => {
|
|
41
|
-
if (circuralTargetPath === '') {
|
|
42
|
-
_.set(res, pathToObj, res);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
let v = _.get(res, circuralTargetPath);
|
|
46
|
-
_.set(res, pathToObj, v);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return res;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
;
|
|
54
|
-
({}); // @--end-of-file-for-module=json10 lib/index.ts
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Generated bundle index. Do not edit.
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
export { JSON10 };
|
|
61
|
-
//# sourceMappingURL=json10.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json10.mjs","sources":["../../../tmp-libs-for-bundle-websql/json10/projects/json10/src/lib/index.ts","../../../tmp-libs-for-bundle-websql/json10/projects/json10/src/json10.ts"],"sourcesContent":["import { _ } from 'tnp-core/websql';\nimport { walk, Models } from 'lodash-walk-object/websql';\nexport type Circ = Models.Circ;\nimport { CLASS } from 'typescript-class-helpers/websql';\n\n\n\n\n\nexport class JSON10 {\n\n public static structureArray(anyJSON: Object, options?: { include?: string[]; exclude?: string[] }) {\n let pathes = []\n const { include, exclude } = options || {} as any;\n walk.Object(anyJSON, (value, lodashPath) => {\n\n if (!_.isUndefined(value)) {\n pathes.push(lodashPath)\n }\n\n }, { include, exclude, checkCircural: true })\n return pathes;\n }\n\n\n public static cleaned(json, onCircs?: (circs: Circ[]) => any, options?:\n {\n exclude?: string[];\n include?: string[];\n breadthWalk?: boolean;\n }) {\n\n const result = _.isArray(json) ? [] : {}\n const classFN = CLASS.OBJECT(json).isClassObject && CLASS.getFromObject(json);\n\n const { exclude, include, breadthWalk } = options || { exclude: [], include: [], breadthWalk: false };\n\n const { circs } = walk.Object(json, (value, lodashPath, changeValueTo, options) => {\n\n if (_.isObject(value) && options.isCircural) {\n _.set(result, lodashPath, null)\n } else {\n _.set(result, lodashPath, _.cloneDeep(value))\n }\n\n }, { include, exclude, breadthWalk, checkCircural: true });\n\n if (_.isFunction(onCircs)) {\n onCircs(circs)\n }\n\n return _.isFunction(classFN) ? _.merge(new (classFN as any)(), result) : result;\n }\n\n public static stringify(anyJSON: Object, replace?: any, spaces?: number, onCircs?: (circs: Circ[]) => any) {\n const json = this.cleaned(anyJSON, onCircs);\n return JSON.stringify(json, replace, spaces);\n }\n\n public static parse(json: string, circs: Circ[] = []) {\n let res = JSON.parse(json);\n if (_.isArray(circs)) {\n circs.forEach(({ circuralTargetPath, pathToObj }) => {\n\n if (circuralTargetPath === '') {\n _.set(res, pathToObj, res)\n } else {\n let v = _.get(res, circuralTargetPath);\n _.set(res, pathToObj, v)\n }\n\n })\n }\n return res;\n }\n}\n\n ;({}); // @--end-of-file-for-module=json10 lib/index.ts","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MASa,MAAM,CAAA;AAEV,IAAA,OAAO,cAAc,CAAC,OAAe,EAAE,OAAoD,EAAA;QAChG,IAAI,MAAM,GAAG,EAAE,CAAA;QACf,MAAM,EAAE,OAAO,EAA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