@ironcode/vas-lib 2.3.0 → 3.0.0-alpha.10
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/cjs/lib/control-value/vas-camera-control-value.model.d.ts +6 -2
- package/cjs/lib/control-value/vas-camera-control-value.model.d.ts.map +1 -1
- package/cjs/lib/control-value/vas-camera-control-value.model.js +10 -0
- package/cjs/lib/control-value/vas-camera-control-value.model.js.map +1 -1
- package/cjs/lib/entity/vas-base.model.d.ts +1 -1
- package/cjs/lib/entity/vas-base.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-base.model.js.map +1 -1
- package/cjs/lib/entity/vas-control.model.d.ts +4 -4
- package/cjs/lib/entity/vas-control.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-control.model.js +1 -1
- package/cjs/lib/entity/vas-control.model.js.map +1 -1
- package/cjs/lib/entity/vas-field.dto.d.ts +4 -7
- package/cjs/lib/entity/vas-field.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-field.dto.js.map +1 -1
- package/cjs/lib/entity/vas-field.model.d.ts +4 -4
- package/cjs/lib/entity/vas-field.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-field.model.js +1 -1
- package/cjs/lib/entity/vas-field.model.js.map +1 -1
- package/cjs/lib/entity/vas-form.model.d.ts +4 -4
- package/cjs/lib/entity/vas-form.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-form.model.js +1 -1
- package/cjs/lib/entity/vas-form.model.js.map +1 -1
- package/cjs/lib/entity/vas-group.model.d.ts +2 -2
- package/cjs/lib/entity/vas-group.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-group.model.js.map +1 -1
- package/cjs/lib/entity/vas-job-copy.d.ts +12 -12
- package/cjs/lib/entity/vas-job-copy.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job-copy.js.map +1 -1
- package/cjs/lib/entity/vas-job.dto.d.ts +12 -6
- package/cjs/lib/entity/vas-job.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.dto.js.map +1 -1
- package/cjs/lib/entity/vas-job.model.d.ts +34 -142
- package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.model.js +248 -341
- package/cjs/lib/entity/vas-job.model.js.map +1 -1
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.d.ts +14 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.d.ts +11 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.js +84 -0
- package/cjs/lib/model/estimate-control/estimate-control-value.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.d.ts +16 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate-item.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.d.ts +24 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.js +121 -0
- package/cjs/lib/model/estimate-control/estimate-item.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.dto.d.ts +37 -0
- package/cjs/lib/model/estimate-control/estimate.dto.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.dto.js +3 -0
- package/cjs/lib/model/estimate-control/estimate.dto.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.model.d.ts +55 -0
- package/cjs/lib/model/estimate-control/estimate.model.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.model.js +279 -0
- package/cjs/lib/model/estimate-control/estimate.model.js.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.types.d.ts +3 -0
- package/cjs/lib/model/estimate-control/estimate.types.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/estimate.types.js +3 -0
- package/cjs/lib/model/estimate-control/estimate.types.js.map +1 -0
- package/cjs/lib/model/estimate-control/index.d.ts +8 -0
- package/cjs/lib/model/estimate-control/index.d.ts.map +1 -0
- package/cjs/lib/model/estimate-control/index.js +11 -0
- package/cjs/lib/model/estimate-control/index.js.map +1 -0
- package/cjs/lib/model/firebase-document-meta.interface.d.ts +6 -0
- package/cjs/lib/model/firebase-document-meta.interface.d.ts.map +1 -0
- package/cjs/lib/model/firebase-document-meta.interface.js +3 -0
- package/cjs/lib/model/firebase-document-meta.interface.js.map +1 -0
- package/cjs/lib/model/index.d.ts +3 -0
- package/cjs/lib/model/index.d.ts.map +1 -1
- package/cjs/lib/model/index.js +3 -0
- package/cjs/lib/model/index.js.map +1 -1
- package/cjs/lib/model/report-invocation.d.ts +40 -0
- package/cjs/lib/model/report-invocation.d.ts.map +1 -0
- package/cjs/lib/model/report-invocation.js +3 -0
- package/cjs/lib/model/report-invocation.js.map +1 -0
- package/cjs/lib/utils/get-value-by-path.d.ts +5 -16
- package/cjs/lib/utils/get-value-by-path.d.ts.map +1 -1
- package/cjs/lib/utils/get-value-by-path.js +48 -59
- package/cjs/lib/utils/get-value-by-path.js.map +1 -1
- package/cjs/lib/utils/index.d.ts +8 -0
- package/cjs/lib/utils/index.d.ts.map +1 -0
- package/cjs/lib/utils/index.js +11 -0
- package/cjs/lib/utils/index.js.map +1 -0
- package/cjs/lib/utils/is-array-string.d.ts +3 -0
- package/cjs/lib/utils/is-array-string.d.ts.map +1 -1
- package/cjs/lib/utils/is-array-string.js +3 -0
- package/cjs/lib/utils/is-array-string.js.map +1 -1
- package/cjs/lib/utils/is-numeric.d.ts +2 -0
- package/cjs/lib/utils/is-numeric.d.ts.map +1 -0
- package/cjs/lib/utils/is-numeric.js +10 -0
- package/cjs/lib/utils/is-numeric.js.map +1 -0
- package/cjs/lib/utils/is-plain-object.d.ts +5 -0
- package/cjs/lib/utils/is-plain-object.d.ts.map +1 -0
- package/cjs/lib/utils/is-plain-object.js +10 -0
- package/cjs/lib/utils/is-plain-object.js.map +1 -0
- package/cjs/lib/utils/try-json.d.ts +6 -0
- package/cjs/lib/utils/try-json.d.ts.map +1 -0
- package/cjs/lib/utils/try-json.js +20 -0
- package/cjs/lib/utils/try-json.js.map +1 -0
- package/cjs/public-api.d.ts +1 -0
- package/cjs/public-api.d.ts.map +1 -1
- package/cjs/public-api.js +1 -0
- package/cjs/public-api.js.map +1 -1
- package/fesm2022/ironcode-vas-lib.mjs +831 -390
- package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
- package/lib/control-value/vas-camera-control-value.model.d.ts +6 -2
- package/lib/entity/vas-base.model.d.ts +1 -1
- package/lib/entity/vas-control.model.d.ts +4 -4
- package/lib/entity/vas-field.dto.d.ts +4 -7
- package/lib/entity/vas-field.model.d.ts +4 -4
- package/lib/entity/vas-form.model.d.ts +4 -4
- package/lib/entity/vas-group.model.d.ts +2 -2
- package/lib/entity/vas-job-copy.d.ts +12 -12
- package/lib/entity/vas-job.dto.d.ts +12 -6
- package/lib/entity/vas-job.model.d.ts +34 -142
- package/lib/model/estimate-control/estimate-control-value.dto.d.ts +13 -0
- package/lib/model/estimate-control/estimate-control-value.model.d.ts +10 -0
- package/lib/model/estimate-control/estimate-item.dto.d.ts +15 -0
- package/lib/model/estimate-control/estimate-item.model.d.ts +23 -0
- package/lib/model/estimate-control/estimate.dto.d.ts +36 -0
- package/lib/model/estimate-control/estimate.model.d.ts +54 -0
- package/lib/model/estimate-control/estimate.types.d.ts +2 -0
- package/lib/model/estimate-control/index.d.ts +7 -0
- package/lib/model/firebase-document-meta.interface.d.ts +5 -0
- package/lib/model/index.d.ts +3 -0
- package/lib/model/report-invocation.d.ts +39 -0
- package/lib/utils/get-value-by-path.d.ts +5 -16
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/is-array-string.d.ts +3 -0
- package/lib/utils/is-numeric.d.ts +1 -0
- package/lib/utils/is-plain-object.d.ts +4 -0
- package/lib/utils/omit.d.ts +7 -0
- package/lib/utils/try-json.d.ts +5 -0
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
- package/cjs/lib/entity/vas-job.model.spec-data.d.ts +0 -2
- package/cjs/lib/entity/vas-job.model.spec-data.d.ts.map +0 -1
- package/cjs/lib/entity/vas-job.model.spec-data.js +0 -29
- package/cjs/lib/entity/vas-job.model.spec-data.js.map +0 -1
|
@@ -1,68 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getValueByPath =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
case 0: {
|
|
3
|
+
exports.getValueByPath = getValueByPath;
|
|
4
|
+
const is_numeric_1 = require("./is-numeric");
|
|
5
|
+
function coalescePath(pathOrPaths) {
|
|
6
|
+
let keys = [];
|
|
7
|
+
if (typeof pathOrPaths === 'string') {
|
|
8
|
+
keys = pathOrPaths.split('.');
|
|
9
|
+
}
|
|
10
|
+
else if (typeof pathOrPaths === 'number') {
|
|
11
|
+
keys = [pathOrPaths];
|
|
12
|
+
}
|
|
13
|
+
else if (Array.isArray(pathOrPaths)) {
|
|
14
|
+
keys = pathOrPaths;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
throw Error('Expected string, number or array of strings or numbers');
|
|
18
|
+
}
|
|
19
|
+
const result = [];
|
|
20
|
+
keys.forEach(key => {
|
|
21
|
+
if (typeof key === 'number') {
|
|
22
|
+
result.push(key);
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return undefined;
|
|
25
|
+
if (key.endsWith(']')) {
|
|
26
|
+
const match = /^([\w_#$-]+)\[([\w_#$-]+)]$/.exec(key.toString());
|
|
27
|
+
if (match !== null) {
|
|
28
|
+
result.push(match[1]);
|
|
29
|
+
result.push((0, is_numeric_1.isNumeric)(match[2]) ? parseInt(match[2], 10) : match[2]);
|
|
30
|
+
return;
|
|
33
31
|
}
|
|
34
|
-
return val0[path[1]];
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
const val2 = val1[path[2]];
|
|
57
|
-
if (!val2) {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
return val2[path[3]];
|
|
61
|
-
}
|
|
62
|
-
default: {
|
|
63
|
-
throw Error('path has too many segments');
|
|
33
|
+
result.push(key);
|
|
34
|
+
});
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get a value from an object by path.
|
|
39
|
+
*
|
|
40
|
+
* Path can be an array of strings or numbers.
|
|
41
|
+
* Path can be a string using dot notation, which can include square brackets to
|
|
42
|
+
* access array positions e.g. foo.bar[0].baz
|
|
43
|
+
*/
|
|
44
|
+
function getValueByPath(path, object) {
|
|
45
|
+
const p = coalescePath(path);
|
|
46
|
+
let scope = object === undefined ? null : object;
|
|
47
|
+
let index = 0;
|
|
48
|
+
const length = p.length;
|
|
49
|
+
while (index < length) {
|
|
50
|
+
if (scope === undefined || scope === null) {
|
|
51
|
+
return undefined;
|
|
64
52
|
}
|
|
53
|
+
scope = scope[p[index++]];
|
|
65
54
|
}
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
return scope;
|
|
56
|
+
}
|
|
68
57
|
//# sourceMappingURL=get-value-by-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-value-by-path.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/get-value-by-path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-value-by-path.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/get-value-by-path.ts"],"names":[],"mappings":";;AA0CA,wCAiBC;AA3DD,6CAAyC;AAEzC,SAAS,YAAY,CACnB,WAAqD;IAErD,IAAI,IAAI,GAA2B,EAAE,CAAC;IACtC,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpC,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;SAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC3C,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,IAAI,GAAG,WAAW,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,CAAC,wDAAwD,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACjB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO;QACT,CAAC;QACD,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,6BAA6B,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YACjE,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtB,MAAM,CAAC,IAAI,CAAC,IAAA,sBAAS,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBACrE,OAAO;YACT,CAAC;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAGD;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,IAA8C,EAC9C,MAAkC;IAElC,MAAM,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7B,IAAI,KAAK,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IACjD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAExB,OAAO,KAAK,GAAG,MAAM,EAAE,CAAC;QACtB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAC1C,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,KAAU,CAAC;AACpB,CAAC","sourcesContent":["import { isNumeric } from './is-numeric';\n\nfunction coalescePath(\n pathOrPaths: string | number | Array<string | number>\n): Array<string | number> {\n let keys: Array<string | number> = [];\n if (typeof pathOrPaths === 'string') {\n keys = pathOrPaths.split('.');\n } else if (typeof pathOrPaths === 'number') {\n keys = [pathOrPaths];\n } else if (Array.isArray(pathOrPaths)) {\n keys = pathOrPaths;\n } else {\n throw Error('Expected string, number or array of strings or numbers');\n }\n const result: Array<string | number> = [];\n keys.forEach(key => {\n if (typeof key === 'number') {\n result.push(key);\n return;\n }\n if (key.endsWith(']')) {\n const match = /^([\\w_#$-]+)\\[([\\w_#$-]+)]$/.exec(key.toString());\n if (match !== null) {\n result.push(match[1]);\n result.push(isNumeric(match[2]) ? parseInt(match[2], 10) : match[2]);\n return;\n }\n }\n result.push(key);\n });\n return result;\n}\n\n\n/**\n * Get a value from an object by path.\n *\n * Path can be an array of strings or numbers.\n * Path can be a string using dot notation, which can include square brackets to\n * access array positions e.g. foo.bar[0].baz\n */\nexport function getValueByPath<T>(\n path: string | number | Array<string | number>,\n object: null | Record<string, any>\n): T | null | undefined {\n const p = coalescePath(path);\n let scope = object === undefined ? null : object;\n let index = 0;\n const length = p.length;\n\n while (index < length) {\n if (scope === undefined || scope === null) {\n return undefined;\n }\n scope = scope[p[index++]];\n }\n\n return scope as T;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./get-value-by-path"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./is-array-string"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./is-numeric"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./is-plain-object"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./omit"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./only"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./try-json"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,4DAAkC;AAClC,uDAA6B;AAC7B,4DAAiC;AACjC,iDAAsB;AACtB,iDAAsB;AACtB,qDAA0B","sourcesContent":["export * from './get-value-by-path';\nexport * from './is-array-string';\nexport * from './is-numeric';\nexport * from './is-plain-object'\nexport * from './omit'\nexport * from './only'\nexport * from './try-json'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-array-string.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-array-string.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,UAAW,GAAG,KAAG,KAAK,IAAI,KAAK,CAAC,MAAM,CAE/D,CAAC"}
|
|
1
|
+
{"version":3,"file":"is-array-string.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-array-string.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,GAAG,KAAG,KAAK,IAAI,KAAK,CAAC,MAAM,CAE/D,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isArrayString = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Return true IFF the array contains only strings
|
|
6
|
+
*/
|
|
4
7
|
const isArrayString = (value) => {
|
|
5
8
|
return Array.isArray(value) && value.every(i => typeof i === 'string');
|
|
6
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-array-string.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-array-string.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"is-array-string.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-array-string.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACI,MAAM,aAAa,GAAG,CAAC,KAAU,EAA0B,EAAE;IAClE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AACzE,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB","sourcesContent":["/**\n * Return true IFF the array contains only strings\n */\nexport const isArrayString = (value: any): value is Array<string> => {\n return Array.isArray(value) && value.every(i => typeof i === 'string');\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-numeric.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-numeric.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,IAAI,MAAM,CAKjE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNumeric = isNumeric;
|
|
4
|
+
function isNumeric(value) {
|
|
5
|
+
if (typeof value === 'number') {
|
|
6
|
+
return !isNaN(value);
|
|
7
|
+
}
|
|
8
|
+
return /^-?\d+$/.test(value.trim());
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=is-numeric.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-numeric.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-numeric.ts"],"names":[],"mappings":";;AAAA,8BAKC;AALD,SAAgB,SAAS,CAAC,KAAsB;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["export function isNumeric(value: string | number): value is number {\n if (typeof value === 'number') {\n return !isNaN(value);\n }\n return /^-?\\d+$/.test(value.trim());\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-plain-object.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-plain-object.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,CAAC,CAEvD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPlainObject = isPlainObject;
|
|
4
|
+
/**
|
|
5
|
+
* Return true if the argument is a plain object {}, i.e. not an array, null.
|
|
6
|
+
*/
|
|
7
|
+
function isPlainObject(value) {
|
|
8
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=is-plain-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-plain-object.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-plain-object.ts"],"names":[],"mappings":";;AAGA,sCAEC;AALD;;GAEG;AACH,SAAgB,aAAa,CAAI,KAAU;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["/**\n * Return true if the argument is a plain object {}, i.e. not an array, null.\n */\nexport function isPlainObject<T>(value: any): value is T {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Try to parse the value as JSON if it looks like a JSON encoded string, return
|
|
3
|
+
* the original value if it's not a JSON string or parsing fails.
|
|
4
|
+
*/
|
|
5
|
+
export declare const tryJson: <T>(value: T) => Record<string, any> | T;
|
|
6
|
+
//# sourceMappingURL=try-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"try-json.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/try-json.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAS3D,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tryJson = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Try to parse the value as JSON if it looks like a JSON encoded string, return
|
|
6
|
+
* the original value if it's not a JSON string or parsing fails.
|
|
7
|
+
*/
|
|
8
|
+
const tryJson = (value) => {
|
|
9
|
+
if (typeof value === 'string' && ['{', '['].includes(value.substring(0, 1))) {
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(value);
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
exports.tryJson = tryJson;
|
|
20
|
+
//# sourceMappingURL=try-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"try-json.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/try-json.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,OAAO,GAAG,CAAI,KAAQ,EAA2B,EAAE;IAC9D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5E,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AATW,QAAA,OAAO,WASlB","sourcesContent":["/**\n * Try to parse the value as JSON if it looks like a JSON encoded string, return\n * the original value if it's not a JSON string or parsing fails.\n */\nexport const tryJson = <T>(value: T): Record<string, any> | T => {\n if (typeof value === 'string' && ['{', '['].includes(value.substring(0, 1))) {\n try {\n return JSON.parse(value);\n } catch (e) {\n return value;\n }\n }\n return value;\n};\n"]}
|
package/cjs/public-api.d.ts
CHANGED
package/cjs/public-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../../projects/vas-lib/src/public-api.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../../projects/vas-lib/src/public-api.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
package/cjs/public-api.js
CHANGED
|
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./lib/controls-config/index"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./lib/elastic/index"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./lib/entity/index"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./lib/model/index"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./lib/utils"), exports);
|
|
9
10
|
//# sourceMappingURL=public-api.js.map
|
package/cjs/public-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../projects/vas-lib/src/public-api.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,sEAA4C;AAC5C,8DAAoC;AACpC,6DAAmC;AACnC,4DAAkC","sourcesContent":["export * from './lib/control-value/index';\nexport * from './lib/controls-config/index';\nexport * from './lib/elastic/index';\nexport * from './lib/entity/index';\nexport * from './lib/model/index';\n"]}
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../projects/vas-lib/src/public-api.ts"],"names":[],"mappings":";;;AAAA,oEAA0C;AAC1C,sEAA4C;AAC5C,8DAAoC;AACpC,6DAAmC;AACnC,4DAAkC;AAClC,sDAA4B","sourcesContent":["export * from './lib/control-value/index';\nexport * from './lib/controls-config/index';\nexport * from './lib/elastic/index';\nexport * from './lib/entity/index';\nexport * from './lib/model/index';\nexport * from './lib/utils';\n"]}
|