tods-competition-factory 1.9.4 → 1.9.5
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/forge/generate.mjs +1 -0
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.d.ts +9 -18
- package/dist/forge/query.mjs +1 -0
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.d.ts +3 -3
- package/dist/forge/transform.mjs +1 -0
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/forge/utilities.d.ts +2 -1
- package/dist/forge/utilities.mjs +25 -24
- package/dist/forge/utilities.mjs.map +1 -1
- package/dist/index.mjs +732 -731
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +1387 -1386
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/package.json +3 -3
|
@@ -6,10 +6,11 @@ declare function nextPowerOf2(n?: any): any;
|
|
|
6
6
|
declare function createMap(objectArray: any, attribute: any): any;
|
|
7
7
|
declare const hasAttributeValues: (a: any) => (o: any) => boolean;
|
|
8
8
|
declare const extractAttributes: (accessor: any) => (element: any) => any;
|
|
9
|
-
declare function definedAttributes(obj: object, ignoreFalse?: boolean, ignoreEmptyArrays?: boolean, shallow?: boolean): any;
|
|
10
9
|
declare function undefinedToNull(obj: object, shallow?: boolean): any;
|
|
11
10
|
declare function generateHashCode(o: any): string | undefined;
|
|
12
11
|
|
|
12
|
+
declare function definedAttributes(obj: object, ignoreFalse?: boolean, ignoreEmptyArrays?: boolean, shallow?: boolean): any;
|
|
13
|
+
|
|
13
14
|
declare function attributeFilter(params?: any): any;
|
|
14
15
|
|
|
15
16
|
declare function generateTimeCode(index?: number): string;
|
package/dist/forge/utilities.mjs
CHANGED
|
@@ -467,30 +467,6 @@ const extractAttributes = (accessor) => (element) => !accessor || typeof element
|
|
|
467
467
|
})) || typeof accessor === "object" && Object.keys(accessor).map((key) => ({
|
|
468
468
|
[key]: getAccessorValue({ element, accessor: key })?.value
|
|
469
469
|
})) || (typeof accessor === "string" && getAccessorValue({ element, accessor }))?.value;
|
|
470
|
-
function getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays) {
|
|
471
|
-
return Object.keys(obj).filter(
|
|
472
|
-
(key) => !ignoreValues.includes(obj[key]) && (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true))
|
|
473
|
-
);
|
|
474
|
-
}
|
|
475
|
-
function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
|
|
476
|
-
if (typeof obj !== "object" || obj === null)
|
|
477
|
-
return obj;
|
|
478
|
-
const deepCopy = deepCopyEnabled();
|
|
479
|
-
if (!deepCopy?.enabled)
|
|
480
|
-
shallow = true;
|
|
481
|
-
const ignoreValues = ["", void 0, null];
|
|
482
|
-
if (ignoreFalse)
|
|
483
|
-
ignoreValues.push(false);
|
|
484
|
-
const definedKeys = getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays);
|
|
485
|
-
return Object.assign(
|
|
486
|
-
{},
|
|
487
|
-
...definedKeys.map((key) => {
|
|
488
|
-
return Array.isArray(obj[key]) ? {
|
|
489
|
-
[key]: shallow ? obj[key] : obj[key].map((m) => definedAttributes(m))
|
|
490
|
-
} : { [key]: shallow ? obj[key] : definedAttributes(obj[key]) };
|
|
491
|
-
})
|
|
492
|
-
);
|
|
493
|
-
}
|
|
494
470
|
function undefinedToNull(obj, shallow) {
|
|
495
471
|
if (obj === void 0)
|
|
496
472
|
return null;
|
|
@@ -524,6 +500,31 @@ function generateHashCode(o) {
|
|
|
524
500
|
return [str.length, keyCount, charSum].map((e) => e.toString(36)).join("");
|
|
525
501
|
}
|
|
526
502
|
|
|
503
|
+
function getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays) {
|
|
504
|
+
return Object.keys(obj).filter(
|
|
505
|
+
(key) => !ignoreValues.includes(obj[key]) && (!ignoreEmptyArrays || (Array.isArray(obj[key]) ? obj[key].length : true))
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
function definedAttributes(obj, ignoreFalse, ignoreEmptyArrays, shallow) {
|
|
509
|
+
if (typeof obj !== "object" || obj === null)
|
|
510
|
+
return obj;
|
|
511
|
+
const deepCopy = deepCopyEnabled();
|
|
512
|
+
if (!deepCopy?.enabled)
|
|
513
|
+
shallow = true;
|
|
514
|
+
const ignoreValues = ["", void 0, null];
|
|
515
|
+
if (ignoreFalse)
|
|
516
|
+
ignoreValues.push(false);
|
|
517
|
+
const definedKeys = getDefinedKeys(obj, ignoreValues, ignoreEmptyArrays);
|
|
518
|
+
return Object.assign(
|
|
519
|
+
{},
|
|
520
|
+
...definedKeys.map((key) => {
|
|
521
|
+
return Array.isArray(obj[key]) ? {
|
|
522
|
+
[key]: shallow ? obj[key] : obj[key].map((m) => definedAttributes(m))
|
|
523
|
+
} : { [key]: shallow ? obj[key] : definedAttributes(obj[key]) };
|
|
524
|
+
})
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
|
|
527
528
|
function attributeFilter(params) {
|
|
528
529
|
if (params === null)
|
|
529
530
|
return {};
|