@ironcode/vas-lib 3.0.0-alpha.1 → 3.0.0-alpha.3
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 +4 -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.map +1 -1
- package/cjs/lib/entity/vas-field.dto.d.ts +3 -4
- 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-job.model.js +1 -1
- 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 +265 -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/index.d.ts +2 -0
- package/cjs/lib/model/index.d.ts.map +1 -1
- package/cjs/lib/model/index.js +2 -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 -15
- package/cjs/lib/utils/get-value-by-path.d.ts.map +1 -1
- package/cjs/lib/utils/get-value-by-path.js +49 -60
- 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 +3 -0
- package/cjs/lib/utils/is-plain-object.d.ts.map +1 -1
- package/cjs/lib/utils/is-plain-object.js +3 -0
- package/cjs/lib/utils/is-plain-object.js.map +1 -1
- package/cjs/lib/utils/try-json.d.ts +2 -2
- package/cjs/lib/utils/try-json.js +2 -2
- package/cjs/lib/utils/try-json.js.map +1 -1
- 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 +548 -56
- package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
- package/lib/control-value/vas-camera-control-value.model.d.ts +4 -2
- package/lib/entity/vas-field.dto.d.ts +3 -4
- 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/index.d.ts +2 -0
- package/lib/model/report-invocation.d.ts +39 -0
- package/lib/utils/get-value-by-path.d.ts +5 -15
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/is-array-string.d.ts +4 -0
- package/lib/utils/is-numeric.d.ts +1 -0
- package/lib/utils/is-plain-object.d.ts +3 -0
- package/lib/utils/omit.d.ts +7 -0
- package/lib/utils/try-json.d.ts +2 -2
- package/package.json +3 -2
- package/public-api.d.ts +1 -0
|
@@ -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
|
-
}
|
|
36
|
-
case 3: {
|
|
37
|
-
const val0 = object[path[0]];
|
|
38
|
-
if (!val0) {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
const val1 = val0[path[1]];
|
|
42
|
-
if (!val1) {
|
|
43
|
-
return undefined;
|
|
44
|
-
}
|
|
45
|
-
return val1[path[2]];
|
|
46
|
-
}
|
|
47
|
-
case 4: {
|
|
48
|
-
const val0 = object[path[0]];
|
|
49
|
-
if (!val0) {
|
|
50
|
-
return undefined;
|
|
51
|
-
}
|
|
52
|
-
const val1 = val0[path[1]];
|
|
53
|
-
if (!val1) {
|
|
54
|
-
return undefined;
|
|
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');
|
|
64
32
|
}
|
|
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 (!(scope === undefined || scope === null) && index < length) {
|
|
50
|
+
scope = scope[p[index++]];
|
|
65
51
|
}
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
if (!(index && index == length) || scope === null) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
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,wCAgBC;AA1DD,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,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;QAClE,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC5B,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAClD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,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 | 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 (!(scope === undefined || scope === null) && index < length) {\n scope = scope[p[index++]];\n }\n if (!(index && index == length) || scope === null) {\n return undefined;\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"]}
|
|
@@ -1 +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,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,CAAC,CAEvD"}
|
|
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"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isPlainObject = isPlainObject;
|
|
4
|
+
/**
|
|
5
|
+
* Return true if the argument is a plain object {}, i.e. not an array, null.
|
|
6
|
+
*/
|
|
4
7
|
function isPlainObject(value) {
|
|
5
8
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
6
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-plain-object.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/utils/is-plain-object.ts"],"names":[],"mappings":";;
|
|
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"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Try to parse the value as JSON if it looks like a JSON encoded string
|
|
3
|
-
*
|
|
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
4
|
*/
|
|
5
5
|
export declare const tryJson: <T>(value: T) => Record<string, any> | T;
|
|
6
6
|
//# sourceMappingURL=try-json.d.ts.map
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.tryJson = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* Try to parse the value as JSON if it looks like a JSON encoded string
|
|
6
|
-
*
|
|
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
7
|
*/
|
|
8
8
|
const tryJson = (value) => {
|
|
9
9
|
if (typeof value === 'string' && ['{', '['].includes(value.substring(0, 1))) {
|
|
@@ -1 +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\n *
|
|
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"]}
|