@awesomeness-js/utils 1.0.23 → 1.0.25

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.
Files changed (88) hide show
  1. package/build/build.js +11 -11
  2. package/build/postBuild.js +8 -8
  3. package/eslint.config.js +90 -0
  4. package/index.js +139 -136
  5. package/package.json +25 -25
  6. package/schemas/schema1.js +5 -1
  7. package/schemas/schema2.js +5 -1
  8. package/schemas.js +14 -14
  9. package/src/build.js +12 -8
  10. package/src/clean/boolean.js +27 -17
  11. package/src/clean/integer.js +85 -69
  12. package/src/clean/number.js +103 -86
  13. package/src/clean/string.js +91 -67
  14. package/src/clean/timestamp.js +61 -45
  15. package/src/clean/uuid.js +38 -25
  16. package/src/collectImports.js +195 -0
  17. package/src/combineFiles.js +45 -36
  18. package/src/convertBytes.js +12 -7
  19. package/src/decrypt.js +17 -9
  20. package/src/each.js +26 -4
  21. package/src/eachAsync.js +35 -19
  22. package/src/encrypt.js +22 -17
  23. package/src/getAllFiles.js +55 -41
  24. package/src/ignoreFolder/ignoreMe.js +6 -2
  25. package/src/ignoreMe.js +4 -2
  26. package/src/isUUID.js +4 -0
  27. package/src/md5.js +5 -1
  28. package/src/password/check.js +7 -3
  29. package/src/password/hash.js +12 -7
  30. package/src/setLocalEnvs.js +16 -3
  31. package/src/thingType.js +62 -24
  32. package/src/toPennies.js +23 -5
  33. package/src/utils/buildExportsTree.js +45 -17
  34. package/src/utils/buildFileDataList.js +32 -17
  35. package/src/utils/clean.js +205 -120
  36. package/src/utils/extractJSDocComment.js +14 -7
  37. package/src/utils/generateFile.js +20 -18
  38. package/src/utils/generateFlatExportLines.js +34 -17
  39. package/src/utils/generateImportStatements.js +15 -7
  40. package/src/utils/generateNamedExports.js +20 -9
  41. package/src/utils/generateNamespaceCode.js +45 -24
  42. package/src/utils/generateNamespaceExportLines.js +16 -7
  43. package/src/utils/shouldIgnore.js +57 -37
  44. package/src/uuid.js +9 -7
  45. package/src/validateSchema.js +95 -77
  46. package/test/collectImports.js +8 -0
  47. package/test/css/some.css +3 -0
  48. package/test/css/some.js +5 -0
  49. package/test/ignoreFolder/ignoreMe.js +3 -1
  50. package/test/ignoreFolder/ignoreMe2.js +3 -1
  51. package/test/ignoreFolder2/ignoreMe.js +6 -2
  52. package/test/js/abc.test.js +7 -3
  53. package/test/js/some.js +5 -0
  54. package/test/secret.test.js +1 -1
  55. package/tests/clean/array.test.js +122 -74
  56. package/tests/clean/boolean.test.js +18 -6
  57. package/tests/clean/integer.test.js +25 -9
  58. package/tests/clean/number.test.js +49 -13
  59. package/tests/clean/object.test.js +190 -119
  60. package/tests/clean/string.test.js +48 -17
  61. package/tests/clean/timestamp.test.js +12 -5
  62. package/tests/clean/uuid.test.js +13 -6
  63. package/tests/collectImports.test.js +66 -0
  64. package/tests/combineFiles.test.js +28 -26
  65. package/tests/convertBytes.test.js +8 -3
  66. package/tests/env.test.js +9 -3
  67. package/tests/example.test.js +7 -3
  68. package/tests/fileList.test.js +16 -12
  69. package/tests/hash-and-encrypt.test.js +13 -4
  70. package/tests/md5.test.js +7 -2
  71. package/tests/uuid.test.js +10 -4
  72. package/tests/validateSchema.test.js +21 -9
  73. package/tsconfig.json +20 -16
  74. package/types/clean/array.d.ts +2 -1
  75. package/types/clean/boolean.d.ts +3 -3
  76. package/types/clean/integer.d.ts +6 -6
  77. package/types/clean/number.d.ts +8 -8
  78. package/types/clean/object.d.ts +2 -1
  79. package/types/clean/string.d.ts +8 -7
  80. package/types/clean/timestamp.d.ts +5 -5
  81. package/types/clean/uuid.d.ts +3 -3
  82. package/types/collectImports.d.ts +6 -0
  83. package/types/combineFiles.d.ts +5 -2
  84. package/types/each.d.ts +10 -10
  85. package/types/index.d.ts +117 -114
  86. package/types/thingType.d.ts +2 -2
  87. package/types/utils/clean.d.ts +19 -2
  88. package/types/validateSchema.d.ts +2 -2
@@ -1,43 +1,63 @@
1
1
  export default function shouldIgnore(filePath, ignorePatterns) {
2
- // filePath is already something like "/css/some.js"
3
- return ignorePatterns.some(pattern => {
4
- // pattern might be "/css/*.js" or "/ignoreFolder", etc.
5
- let normalizedPattern = pattern.replace(/\\/g, '/');
6
-
7
- // 1) Full directory ignore: "/ignoreFolder" => ignore "/ignoreFolder" + subdirectories
8
- // If the pattern ends with "/", treat it as a directory path.
9
- if (!normalizedPattern.includes('*')) {
10
- // e.g. "/ignoreFolder/"
11
- if (normalizedPattern.endsWith('/')) {
12
- normalizedPattern = normalizedPattern.slice(0, -1); // remove trailing slash
13
- }
14
- return filePath === normalizedPattern || filePath.startsWith(normalizedPattern + '/');
15
- }
16
-
17
- // 2) folder/* => Ignore all immediate children in that folder (no subfolders)
18
- if (normalizedPattern.endsWith('/*')) {
19
- const baseFolder = normalizedPattern.slice(0, -2); // e.g. "/css"
20
- // e.g. filePath === "/css/some.js" => startsWith("/css/")
21
- // But also ensure there's no further subfolder.
22
- return filePath.startsWith(baseFolder + '/') &&
2
+
3
+ // filePath is already something like "/css/some.js"
4
+ return ignorePatterns.some((pattern) => {
5
+
6
+ // pattern might be "/css/*.js" or "/ignoreFolder", etc.
7
+ let normalizedPattern = pattern.replace(/\\/g, '/');
8
+
9
+ // 1) Full directory ignore: "/ignoreFolder" => ignore "/ignoreFolder" + subdirectories
10
+ // If the pattern ends with "/", treat it as a directory path.
11
+ if (!normalizedPattern.includes('*')) {
12
+
13
+ // e.g. "/ignoreFolder/"
14
+ if (normalizedPattern.endsWith('/')) {
15
+
16
+ normalizedPattern = normalizedPattern.slice(0, -1); // remove trailing slash
17
+
18
+ }
19
+
20
+ return filePath === normalizedPattern || filePath.startsWith(normalizedPattern + '/');
21
+
22
+ }
23
+
24
+ // 2) folder/* => Ignore all immediate children in that folder (no subfolders)
25
+ if (normalizedPattern.endsWith('/*')) {
26
+
27
+ const baseFolder = normalizedPattern.slice(0, -2); // e.g. "/css"
28
+ // e.g. filePath === "/css/some.js" => startsWith("/css/")
29
+ // But also ensure there's no further subfolder.
30
+
31
+ return filePath.startsWith(baseFolder + '/') &&
23
32
  !filePath.slice(baseFolder.length + 1).includes('/');
24
- }
25
-
26
- // 3) *.ext => extension-based ignore (any folder)
27
- if (normalizedPattern.startsWith('*.')) {
28
- const ext = normalizedPattern.slice(1); // remove '*'
29
- return filePath.endsWith(ext);
30
- }
31
-
32
- // 4) folder/*.ext => only files with that extension in that folder (no subfolders)
33
- if (normalizedPattern.includes('/*')) {
34
- const [baseFolder, ext] = normalizedPattern.split('/*');
35
- return filePath.startsWith(baseFolder + '/') &&
33
+
34
+ }
35
+
36
+ // 3) *.ext => extension-based ignore (any folder)
37
+ if (normalizedPattern.startsWith('*.')) {
38
+
39
+ const ext = normalizedPattern.slice(1); // remove '*'
40
+
41
+
42
+ return filePath.endsWith(ext);
43
+
44
+ }
45
+
46
+ // 4) folder/*.ext => only files with that extension in that folder (no subfolders)
47
+ if (normalizedPattern.includes('/*')) {
48
+
49
+ const [ baseFolder, ext ] = normalizedPattern.split('/*');
50
+
51
+
52
+ return filePath.startsWith(baseFolder + '/') &&
36
53
  filePath.endsWith(ext) &&
37
54
  !filePath.slice(baseFolder.length + 1).includes('/');
38
- }
55
+
56
+ }
57
+
58
+ // 5) Exact match
59
+ return filePath === normalizedPattern;
60
+
61
+ });
39
62
 
40
- // 5) Exact match
41
- return filePath === normalizedPattern;
42
- });
43
63
  }
package/src/uuid.js CHANGED
@@ -2,15 +2,17 @@ import crypto from 'crypto';
2
2
 
3
3
  // V4
4
4
  function uuid() {
5
- const arr = crypto.randomBytes(16);
6
5
 
7
- // Set the UUID version and clock sequence bits as per RFC4122
8
- arr[6] = (arr[6] & 0x0f) | 0x40;
9
- arr[8] = (arr[8] & 0x3f) | 0x80;
6
+ const arr = crypto.randomBytes(16);
7
+
8
+ // Set the UUID version and clock sequence bits as per RFC4122
9
+ arr[6] = (arr[6] & 0x0f) | 0x40;
10
+ arr[8] = (arr[8] & 0x3f) | 0x80;
11
+
12
+ return [ ...arr ].map((b, i) =>
13
+ [ 4, 6, 8, 10 ].includes(i) ? '-' + b.toString(16).padStart(2, '0') : b.toString(16).padStart(2, '0')
14
+ ).join('');
10
15
 
11
- return [...arr].map((b, i) =>
12
- [4, 6, 8, 10].includes(i) ? '-' + b.toString(16).padStart(2, '0') : b.toString(16).padStart(2, '0')
13
- ).join('');
14
16
  }
15
17
 
16
18
  export default uuid;
@@ -2,83 +2,101 @@ import each from './each.js';
2
2
 
3
3
  function validateSchema(schema){
4
4
 
5
- if(!schema){
6
- throw {
7
- message: 'Schema is required.',
8
- schema
9
- };
10
- }
11
-
12
- // ref todo
13
- if(schema.ref){ return true; }
14
-
15
- let schemaType = typeof schema;
16
-
17
- if(schemaType !== 'object' || schema === null) {
18
- throw {
19
- message: 'Schema Invalid - Input must be an object',
20
- schema,
21
- schemaType
22
- };
23
- }
24
-
25
- // object properties dont have type
26
- if(!schema.type && schema.properties){ schema.type = 'object'; }
27
-
28
- const validTypes = [
29
- 'array',
30
- 'boolean',
31
- 'integer',
32
- 'number',
33
- 'object',
34
- 'string',
35
- 'timestamp',
36
- 'uuid'
37
- ];
38
-
39
- if(!schema.type || !validTypes.includes(schema.type)) {
40
- throw {
41
- message: `Schema must have a valid type.`,
42
- validTypes,
43
- schema
44
- };
45
- }
46
-
47
-
48
- if(schema.type === 'object') {
49
-
50
- if(schema.properties){
51
-
52
- // run through each property
53
- each(schema.properties, (v,k) => {
54
- validateSchema(v);
55
- });
56
-
57
- } else {
58
-
59
- throw {
60
- message: 'Object invalid - needs "properties"',
61
- schema
62
- }
63
-
64
- }
65
-
66
- }
67
-
68
- if(schema.type === 'array') {
69
-
70
- if(!schema.items){
71
- throw {
72
- message: 'Array schema must have items defined.',
73
- schema
74
- };
75
- }
76
-
77
- validateSchema(schema.items);
78
-
79
- }
80
-
81
- return true;
5
+ if(!schema){
6
+
7
+ throw {
8
+ message: 'Schema is required.',
9
+ schema
10
+ };
11
+
12
+ }
13
+
14
+ // ref todo
15
+ if(schema.ref){
16
+
17
+ return true;
18
+
19
+ }
20
+
21
+ let schemaType = typeof schema;
22
+
23
+ if(schemaType !== 'object' || schema === null) {
24
+
25
+ throw {
26
+ message: 'Schema Invalid - Input must be an object',
27
+ schema,
28
+ schemaType
29
+ };
30
+
31
+ }
32
+
33
+ // object properties dont have type
34
+ if(!schema.type && schema.properties){
35
+
36
+ schema.type = 'object';
37
+
38
+ }
39
+
40
+ const validTypes = [
41
+ 'array',
42
+ 'boolean',
43
+ 'integer',
44
+ 'number',
45
+ 'object',
46
+ 'string',
47
+ 'timestamp',
48
+ 'uuid'
49
+ ];
50
+
51
+ if(!schema.type || !validTypes.includes(schema.type)) {
52
+
53
+ throw {
54
+ message: `Schema must have a valid type.`,
55
+ validTypes,
56
+ schema
57
+ };
58
+
59
+ }
60
+
61
+
62
+ if(schema.type === 'object') {
63
+
64
+ if(schema.properties){
65
+
66
+ // run through each property
67
+ each(schema.properties, (v,k) => {
68
+
69
+ validateSchema(v);
70
+
71
+ });
72
+
73
+ } else {
74
+
75
+ throw {
76
+ message: 'Object invalid - needs "properties"',
77
+ schema
78
+ };
79
+
80
+ }
81
+
82
+ }
83
+
84
+ if(schema.type === 'array') {
85
+
86
+ if(!schema.items){
87
+
88
+ throw {
89
+ message: 'Array schema must have items defined.',
90
+ schema
91
+ };
92
+
93
+ }
94
+
95
+ validateSchema(schema.items);
96
+
97
+ }
98
+
99
+ return true;
82
100
 
83
101
  }
84
102
 
@@ -0,0 +1,8 @@
1
+ import './css/some.css';
2
+ import './js/some.js';
3
+
4
+ export default () => {
5
+
6
+ console.log('collectImports.js');
7
+
8
+ };
package/test/css/some.css CHANGED
@@ -0,0 +1,3 @@
1
+ .justATest {
2
+ background-color: aliceblue;
3
+ }
package/test/css/some.js CHANGED
@@ -0,0 +1,5 @@
1
+ export default () => {
2
+
3
+ console.log('some.js');
4
+
5
+ };
@@ -1,3 +1,5 @@
1
1
  export default () => {
2
- console.log('I should not be in the build!');
2
+
3
+ console.log('I should not be in the build!');
4
+
3
5
  };
@@ -1,3 +1,5 @@
1
1
  export default async () => {
2
- console.log('I should not be in the build!');
2
+
3
+ console.log('I should not be in the build!');
4
+
3
5
  };
@@ -1,3 +1,7 @@
1
1
  export default function ignoreMeTest() {
2
- console.log('I should not be in the build!');
3
- };
2
+
3
+ console.log('I should not be in the build!');
4
+
5
+ }
6
+
7
+ ;
@@ -1,6 +1,10 @@
1
1
  // example.test.js
2
- import { expect, test } from 'vitest'
2
+ import {
3
+ expect, test
4
+ } from 'vitest';
3
5
 
4
6
  test('adds 2 + 3 to equal 5', () => {
5
- expect(2 + 3).toBe(5)
6
- })
7
+
8
+ expect(2 + 3).toBe(5);
9
+
10
+ });
package/test/js/some.js CHANGED
@@ -0,0 +1,5 @@
1
+ export default () => {
2
+
3
+ console.log('some.js');
4
+
5
+ };
@@ -3,5 +3,5 @@
3
3
  import { expect, test } from 'vitest'
4
4
 
5
5
  test('adds 2 + 3 to equal 5', () => {
6
- expect(2 + 3).toBe(5)
6
+ expect(2 + 3).toBe(5)
7
7
  })
@@ -1,154 +1,202 @@
1
1
  // example.test.js
2
- import { expect, test } from 'vitest'
2
+ import {
3
+ expect, test
4
+ } from 'vitest';
3
5
  import utils from '../../index.js';
4
6
 
5
7
  const testStringArray = [ 'a', 'b', 'c' ];
6
8
  const testIntegerArray = [ 1, 2, 3, 4, 5 ];
7
- const testBooleanArray = [true, false, true, false];
9
+ const testBooleanArray = [ true, false, true, false ];
8
10
 
9
11
  const testArrayOfArraysOfIntegers = [
10
- testIntegerArray,
11
- testIntegerArray,
12
- testIntegerArray
12
+ testIntegerArray,
13
+ testIntegerArray,
14
+ testIntegerArray
13
15
  ];
14
16
 
15
17
  const testArrayOfArraysOfStrings = [
16
- testStringArray,
17
- testStringArray,
18
- testStringArray
18
+ testStringArray,
19
+ testStringArray,
20
+ testStringArray
19
21
  ];
20
22
 
21
23
  const schemaForStrings = {
22
- type: 'array',
23
- items: {
24
- type: 'string'
25
- }
24
+ type: 'array',
25
+ items: {
26
+ type: 'string'
27
+ }
26
28
  };
27
29
 
28
30
  const schemaForIntegers = {
29
- type: 'array',
30
- items: {
31
- type: 'integer'
32
- }
31
+ type: 'array',
32
+ items: {
33
+ type: 'integer'
34
+ }
33
35
  };
34
36
 
35
37
 
36
38
  const schemaForBooleans = {
37
- type: 'array',
38
- items: {
39
- type: 'boolean'
40
- }
39
+ type: 'array',
40
+ items: {
41
+ type: 'boolean'
42
+ }
41
43
  };
42
44
 
43
45
  const schemaForArrayOfArrays_integers = {
44
- type: 'array',
45
- items: {
46
- type: 'array',
47
- items: { type: 'integer' }
48
- }
46
+ type: 'array',
47
+ items: {
48
+ type: 'array',
49
+ items: { type: 'integer' }
50
+ }
49
51
  };
50
52
 
51
53
  const schemaForArrayOfArrays_strings = {
52
- type: 'array',
53
- items: {
54
- type: 'array',
55
- items: { type: 'string' }
56
- }
54
+ type: 'array',
55
+ items: {
56
+ type: 'array',
57
+ items: { type: 'string' }
58
+ }
57
59
  };
58
60
 
59
61
  const testObject = {
60
- stringProp: 'a string',
61
- integerProp: 42,
62
- numberProp: 3.14,
63
- booleanProp: true,
64
- timestampProp: new Date().toISOString(),
65
- uuidProp: utils.uuid(), // generate a valid UUID
62
+ stringProp: 'a string',
63
+ integerProp: 42,
64
+ numberProp: 3.14,
65
+ booleanProp: true,
66
+ timestampProp: new Date().toISOString(),
67
+ uuidProp: utils.uuid(), // generate a valid UUID
66
68
  };
67
69
 
68
70
  const arrayOfObjects = [
69
- { ...testObject },
70
- { ...testObject },
71
- { ...testObject }
71
+ { ...testObject },
72
+ { ...testObject },
73
+ { ...testObject }
72
74
  ];
73
75
 
74
76
  const objSchema = {
75
- type: 'object',
76
- properties: {
77
- stringProp: { type: 'string', required: true },
78
- integerProp: { type: 'integer', required: true },
79
- numberProp: { type: 'number', required: true },
80
- booleanProp: { type: 'boolean', required: true },
81
- timestampProp: { type: 'timestamp', required: true },
82
- uuidProp: { type: 'uuid', required: true },
83
- optionalStringProp: { type: 'string', required: false },
84
- optionalIntegerProp: { type: 'integer', required: false },
85
- optionalNumberProp: { type: 'number', required: false },
86
- optionalBooleanProp: { type: 'boolean', required: false },
87
- optionalTimestampProp: { type: 'timestamp', required: false },
88
- optionalUuidProp: { type: 'uuid', required: false }
89
- },
77
+ type: 'object',
78
+ properties: {
79
+ stringProp: {
80
+ type: 'string',
81
+ required: true
82
+ },
83
+ integerProp: {
84
+ type: 'integer',
85
+ required: true
86
+ },
87
+ numberProp: {
88
+ type: 'number',
89
+ required: true
90
+ },
91
+ booleanProp: {
92
+ type: 'boolean',
93
+ required: true
94
+ },
95
+ timestampProp: {
96
+ type: 'timestamp',
97
+ required: true
98
+ },
99
+ uuidProp: {
100
+ type: 'uuid',
101
+ required: true
102
+ },
103
+ optionalStringProp: {
104
+ type: 'string',
105
+ required: false
106
+ },
107
+ optionalIntegerProp: {
108
+ type: 'integer',
109
+ required: false
110
+ },
111
+ optionalNumberProp: {
112
+ type: 'number',
113
+ required: false
114
+ },
115
+ optionalBooleanProp: {
116
+ type: 'boolean',
117
+ required: false
118
+ },
119
+ optionalTimestampProp: {
120
+ type: 'timestamp',
121
+ required: false
122
+ },
123
+ optionalUuidProp: {
124
+ type: 'uuid',
125
+ required: false
126
+ }
127
+ },
90
128
  };
91
129
 
92
130
 
93
131
  const schemaForArrayOfObjects = {
94
- type: 'array',
95
- required: true,
96
- items: {
97
- ... objSchema,
98
- }
132
+ type: 'array',
133
+ required: true,
134
+ items: {
135
+ ... objSchema,
136
+ }
99
137
  };
100
138
 
101
139
  test('testStringArray', () => {
102
140
 
103
- const x = utils.clean.array(testStringArray, schemaForStrings);
104
- expect(x).toStrictEqual(testStringArray);
141
+ const x = utils.clean.array(testStringArray, schemaForStrings);
142
+
143
+ expect(x).toStrictEqual(testStringArray);
105
144
 
106
145
  });
107
146
 
108
147
  test('testIntegerArray', () => {
109
148
 
110
- const x = utils.clean.array(testIntegerArray, schemaForIntegers);
111
- expect(x).toStrictEqual(testIntegerArray);
149
+ const x = utils.clean.array(testIntegerArray, schemaForIntegers);
150
+
151
+ expect(x).toStrictEqual(testIntegerArray);
112
152
 
113
153
  });
114
154
 
115
155
  test('testBooleanArray', () => {
116
156
 
117
- const x = utils.clean.array(testBooleanArray, schemaForBooleans);
118
- expect(x).toStrictEqual(testBooleanArray);
157
+ const x = utils.clean.array(testBooleanArray, schemaForBooleans);
158
+
159
+ expect(x).toStrictEqual(testBooleanArray);
119
160
 
120
161
  });
121
162
 
122
163
  test('testBooleanArray but pass different schema', () => {
123
164
 
124
- expect(()=> utils.clean.array(testBooleanArray, { ... schemaForIntegers, required: true }) ).toThrow();
165
+ expect(()=> utils.clean.array(testBooleanArray, {
166
+ ... schemaForIntegers,
167
+ required: true
168
+ }) ).toThrow();
125
169
 
126
170
  });
127
171
 
128
172
  test('schemaForArrayOfArrays_integers', () => {
129
173
 
130
- const x = utils.clean.array(testArrayOfArraysOfIntegers, schemaForArrayOfArrays_integers);
131
- expect(x).toStrictEqual(testArrayOfArraysOfIntegers);
174
+ const x = utils.clean.array(testArrayOfArraysOfIntegers, schemaForArrayOfArrays_integers);
175
+
176
+ expect(x).toStrictEqual(testArrayOfArraysOfIntegers);
132
177
 
133
178
  });
134
179
 
135
180
  test('schemaForArrayOfArrays_strings', () => {
136
181
 
137
- const x = utils.clean.array(testArrayOfArraysOfStrings, schemaForArrayOfArrays_strings);
138
- expect(x).toStrictEqual(testArrayOfArraysOfStrings);
182
+ const x = utils.clean.array(testArrayOfArraysOfStrings, schemaForArrayOfArrays_strings);
183
+
184
+ expect(x).toStrictEqual(testArrayOfArraysOfStrings);
139
185
 
140
186
  });
141
187
 
142
188
  test('schemaForArrayOfArrays_strings wrong type', () => {
143
189
 
144
- const x = utils.clean.array(testArrayOfArraysOfStrings, schemaForArrayOfArrays_integers);
145
- expect(x).toBe(null);
190
+ const x = utils.clean.array(testArrayOfArraysOfStrings, schemaForArrayOfArrays_integers);
191
+
192
+ expect(x).toBe(null);
146
193
 
147
194
  });
148
195
 
149
196
  test('schemaForArrayOfObjects', () => {
150
197
 
151
- const x = utils.clean.array(arrayOfObjects, schemaForArrayOfObjects);
152
- expect(x).toStrictEqual(arrayOfObjects);
198
+ const x = utils.clean.array(arrayOfObjects, schemaForArrayOfObjects);
199
+
200
+ expect(x).toStrictEqual(arrayOfObjects);
153
201
 
154
202
  });