@awesomeness-js/utils 1.2.2 → 1.2.4
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/index.js +179 -179
- package/package.json +1 -1
- package/src/utils/clean.js +9 -1
- package/types/build.d.ts +10 -10
- package/types/clean/boolean.d.ts +3 -3
- package/types/clean/integer.d.ts +6 -6
- package/types/clean/number.d.ts +8 -8
- package/types/clean/timestamp.d.ts +5 -5
- package/types/clean/uuid.d.ts +3 -3
- package/types/collectImports.d.ts +6 -6
- package/types/combineFiles.d.ts +8 -8
- package/types/convertBytes.d.ts +8 -8
- package/types/decrypt.d.ts +1 -1
- package/types/each.d.ts +10 -10
- package/types/eachAsync.d.ts +1 -1
- package/types/encrypt.d.ts +5 -5
- package/types/getAllFiles.d.ts +6 -6
- package/types/isUUID.d.ts +1 -1
- package/types/md5.d.ts +2 -2
- package/types/password/check.d.ts +1 -1
- package/types/password/hash.d.ts +1 -1
- package/types/setLocalEnvs.d.ts +2 -2
- package/types/shouldIgnore.d.ts +1 -1
- package/types/thingType.d.ts +2 -2
- package/types/toPennies.d.ts +1 -1
- package/types/utils/buildExportsTree.d.ts +4 -4
- package/types/utils/buildFileDataList.d.ts +12 -12
- package/types/utils/extractJSDocComment.d.ts +1 -1
- package/types/utils/generateFile.d.ts +8 -8
- package/types/utils/generateFlatExportLines.d.ts +7 -7
- package/types/utils/generateImportStatements.d.ts +5 -5
- package/types/utils/generateNamedExports.d.ts +7 -7
- package/types/utils/generateNamespaceCode.d.ts +7 -7
- package/types/utils/generateNamespaceExportLines.d.ts +6 -6
- package/types/uuid.d.ts +2 -2
- package/types/validateSchema.d.ts +2 -2
package/index.js
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is auto-generated by the build script.
|
|
3
|
-
* It consolidates API functions for use in the application.
|
|
4
|
-
* Do not edit manually.
|
|
5
|
-
*/
|
|
6
|
-
import _build from './src/build.js';
|
|
7
|
-
import _clean_array from './src/clean/array.js';
|
|
8
|
-
import _clean_boolean from './src/clean/boolean.js';
|
|
9
|
-
import _clean_buffer from './src/clean/buffer.js';
|
|
10
|
-
import _clean_custom from './src/clean/custom.js';
|
|
11
|
-
import _clean_integer from './src/clean/integer.js';
|
|
12
|
-
import _clean_number from './src/clean/number.js';
|
|
13
|
-
import _clean_object from './src/clean/object.js';
|
|
14
|
-
import _clean_string from './src/clean/string.js';
|
|
15
|
-
import _clean_timestamp from './src/clean/timestamp.js';
|
|
16
|
-
import _clean_uuid from './src/clean/uuid.js';
|
|
17
|
-
import _collectImports from './src/collectImports.js';
|
|
18
|
-
import _combineFiles from './src/combineFiles.js';
|
|
19
|
-
import _convertBytes from './src/convertBytes.js';
|
|
20
|
-
import _decrypt from './src/decrypt.js';
|
|
21
|
-
import _each from './src/each.js';
|
|
22
|
-
import _eachAsync from './src/eachAsync.js';
|
|
23
|
-
import _encrypt from './src/encrypt.js';
|
|
24
|
-
import _getAllFiles from './src/getAllFiles.js';
|
|
25
|
-
import _isUUID from './src/isUUID.js';
|
|
26
|
-
import _md5 from './src/md5.js';
|
|
27
|
-
import _password_check from './src/password/check.js';
|
|
28
|
-
import _password_hash from './src/password/hash.js';
|
|
29
|
-
import _random_array from './src/random/array.js';
|
|
30
|
-
import _random_arrayValue from './src/random/arrayValue.js';
|
|
31
|
-
import _random_boolean from './src/random/boolean.js';
|
|
32
|
-
import _random_integer from './src/random/integer.js';
|
|
33
|
-
import _random_number from './src/random/number.js';
|
|
34
|
-
import _random_object from './src/random/object.js';
|
|
35
|
-
import _random_string from './src/random/string.js';
|
|
36
|
-
import _random_timestamp from './src/random/timestamp.js';
|
|
37
|
-
import _random_uuid from './src/random/uuid.js';
|
|
38
|
-
import _setLocalEnvs from './src/setLocalEnvs.js';
|
|
39
|
-
import _shouldIgnore from './src/shouldIgnore.js';
|
|
40
|
-
import _thingType from './src/thingType.js';
|
|
41
|
-
import _toPennies from './src/toPennies.js';
|
|
42
|
-
import _utils_buildExportsTree from './src/utils/buildExportsTree.js';
|
|
43
|
-
import _utils_buildFileDataList from './src/utils/buildFileDataList.js';
|
|
44
|
-
import _utils_clean from './src/utils/clean.js';
|
|
45
|
-
import _utils_extractJSDocComment from './src/utils/extractJSDocComment.js';
|
|
46
|
-
import _utils_generateFile from './src/utils/generateFile.js';
|
|
47
|
-
import _utils_generateFlatExportLines from './src/utils/generateFlatExportLines.js';
|
|
48
|
-
import _utils_generateImportStatements from './src/utils/generateImportStatements.js';
|
|
49
|
-
import _utils_generateNamedExports from './src/utils/generateNamedExports.js';
|
|
50
|
-
import _utils_generateNamespaceCode from './src/utils/generateNamespaceCode.js';
|
|
51
|
-
import _utils_generateNamespaceExportLines from './src/utils/generateNamespaceExportLines.js';
|
|
52
|
-
import _uuid from './src/uuid.js';
|
|
53
|
-
import _validateSchema from './src/validateSchema.js';
|
|
54
|
-
import _wait from './src/wait.js';
|
|
55
|
-
|
|
56
|
-
export { _build as build };
|
|
57
|
-
export { _collectImports as collectImports };
|
|
58
|
-
export { _combineFiles as combineFiles };
|
|
59
|
-
export { _convertBytes as convertBytes };
|
|
60
|
-
export { _decrypt as decrypt };
|
|
61
|
-
export { _each as each };
|
|
62
|
-
export { _eachAsync as eachAsync };
|
|
63
|
-
export { _encrypt as encrypt };
|
|
64
|
-
export { _getAllFiles as getAllFiles };
|
|
65
|
-
export { _isUUID as isUUID };
|
|
66
|
-
export { _md5 as md5 };
|
|
67
|
-
export { _setLocalEnvs as setLocalEnvs };
|
|
68
|
-
export { _shouldIgnore as shouldIgnore };
|
|
69
|
-
export { _thingType as thingType };
|
|
70
|
-
export { _toPennies as toPennies };
|
|
71
|
-
export { _uuid as uuid };
|
|
72
|
-
export { _validateSchema as validateSchema };
|
|
73
|
-
export { _wait as wait };
|
|
74
|
-
|
|
75
|
-
export const clean = {
|
|
76
|
-
array: _clean_array,
|
|
77
|
-
boolean: _clean_boolean,
|
|
78
|
-
buffer: _clean_buffer,
|
|
79
|
-
custom: _clean_custom,
|
|
80
|
-
integer: _clean_integer,
|
|
81
|
-
number: _clean_number,
|
|
82
|
-
object: _clean_object,
|
|
83
|
-
string: _clean_string,
|
|
84
|
-
timestamp: _clean_timestamp,
|
|
85
|
-
uuid: _clean_uuid
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const password = {
|
|
89
|
-
check: _password_check,
|
|
90
|
-
hash: _password_hash
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const random = {
|
|
94
|
-
array: _random_array,
|
|
95
|
-
arrayValue: _random_arrayValue,
|
|
96
|
-
boolean: _random_boolean,
|
|
97
|
-
integer: _random_integer,
|
|
98
|
-
number: _random_number,
|
|
99
|
-
object: _random_object,
|
|
100
|
-
string: _random_string,
|
|
101
|
-
timestamp: _random_timestamp,
|
|
102
|
-
uuid: _random_uuid
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export const utils = {
|
|
106
|
-
buildExportsTree: _utils_buildExportsTree,
|
|
107
|
-
buildFileDataList: _utils_buildFileDataList,
|
|
108
|
-
clean: _utils_clean,
|
|
109
|
-
extractJSDocComment: _utils_extractJSDocComment,
|
|
110
|
-
generateFile: _utils_generateFile,
|
|
111
|
-
generateFlatExportLines: _utils_generateFlatExportLines,
|
|
112
|
-
generateImportStatements: _utils_generateImportStatements,
|
|
113
|
-
generateNamedExports: _utils_generateNamedExports,
|
|
114
|
-
generateNamespaceCode: _utils_generateNamespaceCode,
|
|
115
|
-
generateNamespaceExportLines: _utils_generateNamespaceExportLines
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
export default {
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the build script.
|
|
3
|
+
* It consolidates API functions for use in the application.
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
*/
|
|
6
|
+
import _build from './src/build.js';
|
|
7
|
+
import _clean_array from './src/clean/array.js';
|
|
8
|
+
import _clean_boolean from './src/clean/boolean.js';
|
|
9
|
+
import _clean_buffer from './src/clean/buffer.js';
|
|
10
|
+
import _clean_custom from './src/clean/custom.js';
|
|
11
|
+
import _clean_integer from './src/clean/integer.js';
|
|
12
|
+
import _clean_number from './src/clean/number.js';
|
|
13
|
+
import _clean_object from './src/clean/object.js';
|
|
14
|
+
import _clean_string from './src/clean/string.js';
|
|
15
|
+
import _clean_timestamp from './src/clean/timestamp.js';
|
|
16
|
+
import _clean_uuid from './src/clean/uuid.js';
|
|
17
|
+
import _collectImports from './src/collectImports.js';
|
|
18
|
+
import _combineFiles from './src/combineFiles.js';
|
|
19
|
+
import _convertBytes from './src/convertBytes.js';
|
|
20
|
+
import _decrypt from './src/decrypt.js';
|
|
21
|
+
import _each from './src/each.js';
|
|
22
|
+
import _eachAsync from './src/eachAsync.js';
|
|
23
|
+
import _encrypt from './src/encrypt.js';
|
|
24
|
+
import _getAllFiles from './src/getAllFiles.js';
|
|
25
|
+
import _isUUID from './src/isUUID.js';
|
|
26
|
+
import _md5 from './src/md5.js';
|
|
27
|
+
import _password_check from './src/password/check.js';
|
|
28
|
+
import _password_hash from './src/password/hash.js';
|
|
29
|
+
import _random_array from './src/random/array.js';
|
|
30
|
+
import _random_arrayValue from './src/random/arrayValue.js';
|
|
31
|
+
import _random_boolean from './src/random/boolean.js';
|
|
32
|
+
import _random_integer from './src/random/integer.js';
|
|
33
|
+
import _random_number from './src/random/number.js';
|
|
34
|
+
import _random_object from './src/random/object.js';
|
|
35
|
+
import _random_string from './src/random/string.js';
|
|
36
|
+
import _random_timestamp from './src/random/timestamp.js';
|
|
37
|
+
import _random_uuid from './src/random/uuid.js';
|
|
38
|
+
import _setLocalEnvs from './src/setLocalEnvs.js';
|
|
39
|
+
import _shouldIgnore from './src/shouldIgnore.js';
|
|
40
|
+
import _thingType from './src/thingType.js';
|
|
41
|
+
import _toPennies from './src/toPennies.js';
|
|
42
|
+
import _utils_buildExportsTree from './src/utils/buildExportsTree.js';
|
|
43
|
+
import _utils_buildFileDataList from './src/utils/buildFileDataList.js';
|
|
44
|
+
import _utils_clean from './src/utils/clean.js';
|
|
45
|
+
import _utils_extractJSDocComment from './src/utils/extractJSDocComment.js';
|
|
46
|
+
import _utils_generateFile from './src/utils/generateFile.js';
|
|
47
|
+
import _utils_generateFlatExportLines from './src/utils/generateFlatExportLines.js';
|
|
48
|
+
import _utils_generateImportStatements from './src/utils/generateImportStatements.js';
|
|
49
|
+
import _utils_generateNamedExports from './src/utils/generateNamedExports.js';
|
|
50
|
+
import _utils_generateNamespaceCode from './src/utils/generateNamespaceCode.js';
|
|
51
|
+
import _utils_generateNamespaceExportLines from './src/utils/generateNamespaceExportLines.js';
|
|
52
|
+
import _uuid from './src/uuid.js';
|
|
53
|
+
import _validateSchema from './src/validateSchema.js';
|
|
54
|
+
import _wait from './src/wait.js';
|
|
55
|
+
|
|
56
|
+
export { _build as build };
|
|
57
|
+
export { _collectImports as collectImports };
|
|
58
|
+
export { _combineFiles as combineFiles };
|
|
59
|
+
export { _convertBytes as convertBytes };
|
|
60
|
+
export { _decrypt as decrypt };
|
|
61
|
+
export { _each as each };
|
|
62
|
+
export { _eachAsync as eachAsync };
|
|
63
|
+
export { _encrypt as encrypt };
|
|
64
|
+
export { _getAllFiles as getAllFiles };
|
|
65
|
+
export { _isUUID as isUUID };
|
|
66
|
+
export { _md5 as md5 };
|
|
67
|
+
export { _setLocalEnvs as setLocalEnvs };
|
|
68
|
+
export { _shouldIgnore as shouldIgnore };
|
|
69
|
+
export { _thingType as thingType };
|
|
70
|
+
export { _toPennies as toPennies };
|
|
71
|
+
export { _uuid as uuid };
|
|
72
|
+
export { _validateSchema as validateSchema };
|
|
73
|
+
export { _wait as wait };
|
|
74
|
+
|
|
75
|
+
export const clean = {
|
|
76
|
+
array: _clean_array,
|
|
77
|
+
boolean: _clean_boolean,
|
|
78
|
+
buffer: _clean_buffer,
|
|
79
|
+
custom: _clean_custom,
|
|
80
|
+
integer: _clean_integer,
|
|
81
|
+
number: _clean_number,
|
|
82
|
+
object: _clean_object,
|
|
83
|
+
string: _clean_string,
|
|
84
|
+
timestamp: _clean_timestamp,
|
|
85
|
+
uuid: _clean_uuid
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const password = {
|
|
89
|
+
check: _password_check,
|
|
90
|
+
hash: _password_hash
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const random = {
|
|
94
|
+
array: _random_array,
|
|
95
|
+
arrayValue: _random_arrayValue,
|
|
96
|
+
boolean: _random_boolean,
|
|
97
|
+
integer: _random_integer,
|
|
98
|
+
number: _random_number,
|
|
99
|
+
object: _random_object,
|
|
100
|
+
string: _random_string,
|
|
101
|
+
timestamp: _random_timestamp,
|
|
102
|
+
uuid: _random_uuid
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const utils = {
|
|
106
|
+
buildExportsTree: _utils_buildExportsTree,
|
|
107
|
+
buildFileDataList: _utils_buildFileDataList,
|
|
108
|
+
clean: _utils_clean,
|
|
109
|
+
extractJSDocComment: _utils_extractJSDocComment,
|
|
110
|
+
generateFile: _utils_generateFile,
|
|
111
|
+
generateFlatExportLines: _utils_generateFlatExportLines,
|
|
112
|
+
generateImportStatements: _utils_generateImportStatements,
|
|
113
|
+
generateNamedExports: _utils_generateNamedExports,
|
|
114
|
+
generateNamespaceCode: _utils_generateNamespaceCode,
|
|
115
|
+
generateNamespaceExportLines: _utils_generateNamespaceExportLines
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
export default {
|
|
120
120
|
/**
|
|
121
121
|
* Builds a file from the specified source directory and writes it to the destination file.
|
|
122
122
|
*
|
|
@@ -128,19 +128,19 @@ export default {
|
|
|
128
128
|
* @param {boolean} [options.includeComments=true] - Whether to include comments in the generated file.
|
|
129
129
|
* @param {boolean} [options.dts=false] - Whether to generate TypeScript declaration files.
|
|
130
130
|
* @returns {Promise<boolean>} A promise that resolves to true when the build is complete.
|
|
131
|
-
*/
|
|
132
|
-
build: _build,
|
|
133
|
-
collectImports: _collectImports,
|
|
134
|
-
combineFiles: _combineFiles,
|
|
131
|
+
*/
|
|
132
|
+
build: _build,
|
|
133
|
+
collectImports: _collectImports,
|
|
134
|
+
combineFiles: _combineFiles,
|
|
135
135
|
/**
|
|
136
136
|
* Converts a given number of bytes into a more readable string format with appropriate units.
|
|
137
137
|
*
|
|
138
138
|
* @param {number} bytes - The number of bytes to convert.
|
|
139
139
|
* @param {number} [precision=2] - The number of decimal places to include in the result.
|
|
140
140
|
* @returns {string} The converted bytes in a string format with appropriate units.
|
|
141
|
-
*/
|
|
142
|
-
convertBytes: _convertBytes,
|
|
143
|
-
decrypt: _decrypt,
|
|
141
|
+
*/
|
|
142
|
+
convertBytes: _convertBytes,
|
|
143
|
+
decrypt: _decrypt,
|
|
144
144
|
/**
|
|
145
145
|
* Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
|
|
146
146
|
* The iteration stops if the callback returns `false`.
|
|
@@ -149,57 +149,57 @@ export default {
|
|
|
149
149
|
* @param {Object|Array} objectOrArray - The object or array to iterate over.
|
|
150
150
|
* @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
|
|
151
151
|
* @returns {void}
|
|
152
|
-
*/
|
|
153
|
-
each: _each,
|
|
154
|
-
eachAsync: _eachAsync,
|
|
155
|
-
encrypt: _encrypt,
|
|
156
|
-
getAllFiles: _getAllFiles,
|
|
157
|
-
isUUID: _isUUID,
|
|
158
|
-
md5: _md5,
|
|
159
|
-
setLocalEnvs: _setLocalEnvs,
|
|
160
|
-
shouldIgnore: _shouldIgnore,
|
|
161
|
-
thingType: _thingType,
|
|
162
|
-
toPennies: _toPennies,
|
|
163
|
-
uuid: _uuid,
|
|
164
|
-
validateSchema: _validateSchema,
|
|
165
|
-
wait: _wait,
|
|
166
|
-
clean: {
|
|
167
|
-
array: _clean_array,
|
|
168
|
-
boolean: _clean_boolean,
|
|
169
|
-
buffer: _clean_buffer,
|
|
170
|
-
custom: _clean_custom,
|
|
171
|
-
integer: _clean_integer,
|
|
172
|
-
number: _clean_number,
|
|
173
|
-
object: _clean_object,
|
|
174
|
-
string: _clean_string,
|
|
175
|
-
timestamp: _clean_timestamp,
|
|
176
|
-
uuid: _clean_uuid,
|
|
177
|
-
},
|
|
178
|
-
password: {
|
|
179
|
-
check: _password_check,
|
|
180
|
-
hash: _password_hash,
|
|
181
|
-
},
|
|
182
|
-
random: {
|
|
183
|
-
array: _random_array,
|
|
184
|
-
arrayValue: _random_arrayValue,
|
|
185
|
-
boolean: _random_boolean,
|
|
186
|
-
integer: _random_integer,
|
|
187
|
-
number: _random_number,
|
|
188
|
-
object: _random_object,
|
|
189
|
-
string: _random_string,
|
|
190
|
-
timestamp: _random_timestamp,
|
|
191
|
-
uuid: _random_uuid,
|
|
192
|
-
},
|
|
193
|
-
utils: {
|
|
194
|
-
buildExportsTree: _utils_buildExportsTree,
|
|
195
|
-
buildFileDataList: _utils_buildFileDataList,
|
|
196
|
-
clean: _utils_clean,
|
|
197
|
-
extractJSDocComment: _utils_extractJSDocComment,
|
|
198
|
-
generateFile: _utils_generateFile,
|
|
199
|
-
generateFlatExportLines: _utils_generateFlatExportLines,
|
|
200
|
-
generateImportStatements: _utils_generateImportStatements,
|
|
201
|
-
generateNamedExports: _utils_generateNamedExports,
|
|
202
|
-
generateNamespaceCode: _utils_generateNamespaceCode,
|
|
203
|
-
generateNamespaceExportLines: _utils_generateNamespaceExportLines,
|
|
204
|
-
},
|
|
152
|
+
*/
|
|
153
|
+
each: _each,
|
|
154
|
+
eachAsync: _eachAsync,
|
|
155
|
+
encrypt: _encrypt,
|
|
156
|
+
getAllFiles: _getAllFiles,
|
|
157
|
+
isUUID: _isUUID,
|
|
158
|
+
md5: _md5,
|
|
159
|
+
setLocalEnvs: _setLocalEnvs,
|
|
160
|
+
shouldIgnore: _shouldIgnore,
|
|
161
|
+
thingType: _thingType,
|
|
162
|
+
toPennies: _toPennies,
|
|
163
|
+
uuid: _uuid,
|
|
164
|
+
validateSchema: _validateSchema,
|
|
165
|
+
wait: _wait,
|
|
166
|
+
clean: {
|
|
167
|
+
array: _clean_array,
|
|
168
|
+
boolean: _clean_boolean,
|
|
169
|
+
buffer: _clean_buffer,
|
|
170
|
+
custom: _clean_custom,
|
|
171
|
+
integer: _clean_integer,
|
|
172
|
+
number: _clean_number,
|
|
173
|
+
object: _clean_object,
|
|
174
|
+
string: _clean_string,
|
|
175
|
+
timestamp: _clean_timestamp,
|
|
176
|
+
uuid: _clean_uuid,
|
|
177
|
+
},
|
|
178
|
+
password: {
|
|
179
|
+
check: _password_check,
|
|
180
|
+
hash: _password_hash,
|
|
181
|
+
},
|
|
182
|
+
random: {
|
|
183
|
+
array: _random_array,
|
|
184
|
+
arrayValue: _random_arrayValue,
|
|
185
|
+
boolean: _random_boolean,
|
|
186
|
+
integer: _random_integer,
|
|
187
|
+
number: _random_number,
|
|
188
|
+
object: _random_object,
|
|
189
|
+
string: _random_string,
|
|
190
|
+
timestamp: _random_timestamp,
|
|
191
|
+
uuid: _random_uuid,
|
|
192
|
+
},
|
|
193
|
+
utils: {
|
|
194
|
+
buildExportsTree: _utils_buildExportsTree,
|
|
195
|
+
buildFileDataList: _utils_buildFileDataList,
|
|
196
|
+
clean: _utils_clean,
|
|
197
|
+
extractJSDocComment: _utils_extractJSDocComment,
|
|
198
|
+
generateFile: _utils_generateFile,
|
|
199
|
+
generateFlatExportLines: _utils_generateFlatExportLines,
|
|
200
|
+
generateImportStatements: _utils_generateImportStatements,
|
|
201
|
+
generateNamedExports: _utils_generateNamedExports,
|
|
202
|
+
generateNamespaceCode: _utils_generateNamespaceCode,
|
|
203
|
+
generateNamespaceExportLines: _utils_generateNamespaceExportLines,
|
|
204
|
+
},
|
|
205
205
|
};
|
package/package.json
CHANGED
package/src/utils/clean.js
CHANGED
|
@@ -8,11 +8,13 @@ import cleanNumber from '../clean/number.js';
|
|
|
8
8
|
import cleanString from '../clean/string.js';
|
|
9
9
|
import cleanTimestamp from '../clean/timestamp.js';
|
|
10
10
|
import cleanUUID from '../clean/uuid.js';
|
|
11
|
+
import cleanCustom from '../clean/custom.js';
|
|
11
12
|
|
|
12
13
|
const knownTypesToClean = [
|
|
13
14
|
'array',
|
|
14
15
|
'boolean',
|
|
15
16
|
'buffer',
|
|
17
|
+
'custom',
|
|
16
18
|
'integer',
|
|
17
19
|
'number',
|
|
18
20
|
'object',
|
|
@@ -130,7 +132,7 @@ function cleanArray(arr, schema = {}, {
|
|
|
130
132
|
|
|
131
133
|
if(supposedToBeType === 'object'){
|
|
132
134
|
|
|
133
|
-
cleanedItem = cleanObject(item, schema.
|
|
135
|
+
cleanedItem = cleanObject(item, schema.properties, {
|
|
134
136
|
testMode,
|
|
135
137
|
allOrNothing,
|
|
136
138
|
path: path ? `${path}.${key}` : key
|
|
@@ -138,6 +140,12 @@ function cleanArray(arr, schema = {}, {
|
|
|
138
140
|
|
|
139
141
|
}
|
|
140
142
|
|
|
143
|
+
if(supposedToBeType === 'custom'){
|
|
144
|
+
|
|
145
|
+
cleanedItem = cleanCustom(item, schema.items);
|
|
146
|
+
|
|
147
|
+
}
|
|
148
|
+
|
|
141
149
|
if(cleanedItem === null){
|
|
142
150
|
|
|
143
151
|
if(schema.required === true){
|
package/types/build.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export default build;
|
|
2
|
-
declare function build({ src, dest, exportRoots, ignore, includeComments, dts, useTabs, }?: {
|
|
3
|
-
src?: string;
|
|
4
|
-
dest?: string;
|
|
5
|
-
exportRoots?: boolean;
|
|
6
|
-
ignore?: any[];
|
|
7
|
-
includeComments?: boolean;
|
|
8
|
-
dts?: boolean;
|
|
9
|
-
useTabs?: boolean;
|
|
10
|
-
}): Promise<boolean>;
|
|
1
|
+
export default build;
|
|
2
|
+
declare function build({ src, dest, exportRoots, ignore, includeComments, dts, useTabs, }?: {
|
|
3
|
+
src?: string;
|
|
4
|
+
dest?: string;
|
|
5
|
+
exportRoots?: boolean;
|
|
6
|
+
ignore?: any[];
|
|
7
|
+
includeComments?: boolean;
|
|
8
|
+
dts?: boolean;
|
|
9
|
+
useTabs?: boolean;
|
|
10
|
+
}): Promise<boolean>;
|
package/types/clean/boolean.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function cleanBoolean(x: any, { required }?: {
|
|
2
|
-
required?: boolean;
|
|
3
|
-
}): any;
|
|
1
|
+
export default function cleanBoolean(x: any, { required }?: {
|
|
2
|
+
required?: boolean;
|
|
3
|
+
}): any;
|
package/types/clean/integer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default function cleanInt(x: any, { required, convertString, min, max, }?: {
|
|
2
|
-
required?: boolean;
|
|
3
|
-
convertString?: boolean;
|
|
4
|
-
min?: boolean;
|
|
5
|
-
max?: boolean;
|
|
6
|
-
}): any;
|
|
1
|
+
export default function cleanInt(x: any, { required, convertString, min, max, }?: {
|
|
2
|
+
required?: boolean;
|
|
3
|
+
convertString?: boolean;
|
|
4
|
+
min?: boolean;
|
|
5
|
+
max?: boolean;
|
|
6
|
+
}): any;
|
package/types/clean/number.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export default function cleanNumber(x: any, { required, convertString, min, max, maxDecimal, minDecimal, }?: {
|
|
2
|
-
required?: boolean;
|
|
3
|
-
convertString?: boolean;
|
|
4
|
-
min?: boolean;
|
|
5
|
-
max?: boolean;
|
|
6
|
-
maxDecimal?: boolean;
|
|
7
|
-
minDecimal?: boolean;
|
|
8
|
-
}): any;
|
|
1
|
+
export default function cleanNumber(x: any, { required, convertString, min, max, maxDecimal, minDecimal, }?: {
|
|
2
|
+
required?: boolean;
|
|
3
|
+
convertString?: boolean;
|
|
4
|
+
min?: boolean;
|
|
5
|
+
max?: boolean;
|
|
6
|
+
maxDecimal?: boolean;
|
|
7
|
+
minDecimal?: boolean;
|
|
8
|
+
}): any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default function cleanTimestamp(isoDateTimeString: any, { required, maxDaysInFuture, maxDaysInFPast, }?: {
|
|
2
|
-
required?: boolean;
|
|
3
|
-
maxDaysInFuture?: boolean;
|
|
4
|
-
maxDaysInFPast?: boolean;
|
|
5
|
-
}): string;
|
|
1
|
+
export default function cleanTimestamp(isoDateTimeString: any, { required, maxDaysInFuture, maxDaysInFPast, }?: {
|
|
2
|
+
required?: boolean;
|
|
3
|
+
maxDaysInFuture?: boolean;
|
|
4
|
+
maxDaysInFPast?: boolean;
|
|
5
|
+
}): string;
|
package/types/clean/uuid.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function cleanUUID(uuid: any, { required, }?: {
|
|
2
|
-
required?: boolean;
|
|
3
|
-
}): string;
|
|
1
|
+
export default function cleanUUID(uuid: any, { required, }?: {
|
|
2
|
+
required?: boolean;
|
|
3
|
+
}): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default run;
|
|
2
|
-
declare function run(filePath: any, { returnCode, jsMaps, cssMaps }?: {
|
|
3
|
-
returnCode?: boolean;
|
|
4
|
-
jsMaps?: {};
|
|
5
|
-
cssMaps?: {};
|
|
6
|
-
}): any[];
|
|
1
|
+
export default run;
|
|
2
|
+
declare function run(filePath: any, { returnCode, jsMaps, cssMaps }?: {
|
|
3
|
+
returnCode?: boolean;
|
|
4
|
+
jsMaps?: {};
|
|
5
|
+
cssMaps?: {};
|
|
6
|
+
}): any[];
|
package/types/combineFiles.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export default combineFiles;
|
|
2
|
-
declare function combineFiles(dir: any, fileType: any, { minify, processContent, }?: {
|
|
3
|
-
minify?: boolean;
|
|
4
|
-
processContent?: ({ content, path }: {
|
|
5
|
-
content: any;
|
|
6
|
-
path: any;
|
|
7
|
-
}) => any;
|
|
8
|
-
}): string;
|
|
1
|
+
export default combineFiles;
|
|
2
|
+
declare function combineFiles(dir: any, fileType: any, { minify, processContent, }?: {
|
|
3
|
+
minify?: boolean;
|
|
4
|
+
processContent?: ({ content, path }: {
|
|
5
|
+
content: any;
|
|
6
|
+
path: any;
|
|
7
|
+
}) => any;
|
|
8
|
+
}): string;
|
package/types/convertBytes.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a given number of bytes into a more readable string format with appropriate units.
|
|
3
|
-
*
|
|
4
|
-
* @param {number} bytes - The number of bytes to convert.
|
|
5
|
-
* @param {number} [precision=2] - The number of decimal places to include in the result.
|
|
6
|
-
* @returns {string} The converted bytes in a string format with appropriate units.
|
|
7
|
-
*/
|
|
8
|
-
export default function convertBytes(bytes: number, precision?: number): string;
|
|
1
|
+
/**
|
|
2
|
+
* Converts a given number of bytes into a more readable string format with appropriate units.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} bytes - The number of bytes to convert.
|
|
5
|
+
* @param {number} [precision=2] - The number of decimal places to include in the result.
|
|
6
|
+
* @returns {string} The converted bytes in a string format with appropriate units.
|
|
7
|
+
*/
|
|
8
|
+
export default function convertBytes(bytes: number, precision?: number): string;
|
package/types/decrypt.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function decrypt(encryptedData: any, key?: any): any;
|
|
1
|
+
export default function decrypt(encryptedData: any, key?: any): any;
|
package/types/each.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
|
|
3
|
-
* The iteration stops if the callback returns `false`.
|
|
4
|
-
*
|
|
5
|
-
* @example each({ a: 1, b: 2 }, (value, key) => { console.log(value, key); });
|
|
6
|
-
* @param {Object|Array} objectOrArray - The object or array to iterate over.
|
|
7
|
-
* @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
|
|
8
|
-
* @returns {void}
|
|
9
|
-
*/
|
|
10
|
-
export default function each(objectOrArray: any | any[], callback: Function): void;
|
|
1
|
+
/**
|
|
2
|
+
* Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
|
|
3
|
+
* The iteration stops if the callback returns `false`.
|
|
4
|
+
*
|
|
5
|
+
* @example each({ a: 1, b: 2 }, (value, key) => { console.log(value, key); });
|
|
6
|
+
* @param {Object|Array} objectOrArray - The object or array to iterate over.
|
|
7
|
+
* @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
|
|
8
|
+
* @returns {void}
|
|
9
|
+
*/
|
|
10
|
+
export default function each(objectOrArray: any | any[], callback: Function): void;
|
package/types/eachAsync.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function eachAsync(objectOrArray: any, callback: any): Promise<void>;
|
|
1
|
+
export default function eachAsync(objectOrArray: any, callback: any): Promise<void>;
|
package/types/encrypt.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default function encrypt(plainText: any, key?: any): {
|
|
2
|
-
iv: any;
|
|
3
|
-
authTag: any;
|
|
4
|
-
cipherText: any;
|
|
5
|
-
};
|
|
1
|
+
export default function encrypt(plainText: any, key?: any): {
|
|
2
|
+
iv: any;
|
|
3
|
+
authTag: any;
|
|
4
|
+
cipherText: any;
|
|
5
|
+
};
|
package/types/getAllFiles.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default function getAllFiles(base: any, { dir, files, ignore, fileTypes }?: {
|
|
2
|
-
dir?: string;
|
|
3
|
-
files?: any[];
|
|
4
|
-
ignore?: any[];
|
|
5
|
-
fileTypes?: any[];
|
|
6
|
-
}): any[];
|
|
1
|
+
export default function getAllFiles(base: any, { dir, files, ignore, fileTypes }?: {
|
|
2
|
+
dir?: string;
|
|
3
|
+
files?: any[];
|
|
4
|
+
ignore?: any[];
|
|
5
|
+
fileTypes?: any[];
|
|
6
|
+
}): any[];
|
package/types/isUUID.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isUUID(uuid: any): boolean;
|
|
1
|
+
export default function isUUID(uuid: any): boolean;
|
package/types/md5.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default md5;
|
|
2
|
-
declare function md5(data: any): any;
|
|
1
|
+
export default md5;
|
|
2
|
+
declare function md5(data: any): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function validatePassword(password: any, storedHash: any): boolean;
|
|
1
|
+
export default function validatePassword(password: any, storedHash: any): boolean;
|
package/types/password/hash.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function hashPassword(password: any): string;
|
|
1
|
+
export default function hashPassword(password: any): string;
|
package/types/setLocalEnvs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function _default(localSecretsPath?: string): Promise<void>;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare function _default(localSecretsPath?: string): Promise<void>;
|
|
2
|
+
export default _default;
|
package/types/shouldIgnore.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function shouldIgnore(filePath: any, ignorePatterns: any): any;
|
|
1
|
+
export default function shouldIgnore(filePath: any, ignorePatterns: any): any;
|
package/types/thingType.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function _default(thing: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "null";
|
|
2
|
-
export default _default;
|
|
1
|
+
declare function _default(thing: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" | "null";
|
|
2
|
+
export default _default;
|
package/types/toPennies.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function toPennies(uglyMoney: any): number;
|
|
1
|
+
export default function toPennies(uglyMoney: any): number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function buildExportsTree(fileDataList: any): {
|
|
2
|
-
flatExports: any[];
|
|
3
|
-
nestedExports: {};
|
|
4
|
-
};
|
|
1
|
+
export default function buildExportsTree(fileDataList: any): {
|
|
2
|
+
flatExports: any[];
|
|
3
|
+
nestedExports: {};
|
|
4
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export default function buildFileDataList({ src, ignore, includeComments }: {
|
|
2
|
-
src: any;
|
|
3
|
-
ignore: any;
|
|
4
|
-
includeComments: any;
|
|
5
|
-
}): {
|
|
6
|
-
normalizedFile: any;
|
|
7
|
-
parts: any;
|
|
8
|
-
functionName: any;
|
|
9
|
-
importVarName: string;
|
|
10
|
-
importPath: string;
|
|
11
|
-
jsDocComment: string;
|
|
12
|
-
}[];
|
|
1
|
+
export default function buildFileDataList({ src, ignore, includeComments }: {
|
|
2
|
+
src: any;
|
|
3
|
+
ignore: any;
|
|
4
|
+
includeComments: any;
|
|
5
|
+
}): {
|
|
6
|
+
normalizedFile: any;
|
|
7
|
+
parts: any;
|
|
8
|
+
functionName: any;
|
|
9
|
+
importVarName: string;
|
|
10
|
+
importPath: string;
|
|
11
|
+
jsDocComment: string;
|
|
12
|
+
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function extractJSDocComment(filePath: any): string;
|
|
1
|
+
export default function extractJSDocComment(filePath: any): string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export default function generateFile({ src, exportRoots, ignore, includeComments, dts, useTabs }: {
|
|
2
|
-
src: any;
|
|
3
|
-
exportRoots: any;
|
|
4
|
-
ignore: any;
|
|
5
|
-
includeComments: any;
|
|
6
|
-
dts: any;
|
|
7
|
-
useTabs?: boolean;
|
|
8
|
-
}): string;
|
|
1
|
+
export default function generateFile({ src, exportRoots, ignore, includeComments, dts, useTabs }: {
|
|
2
|
+
src: any;
|
|
3
|
+
exportRoots: any;
|
|
4
|
+
ignore: any;
|
|
5
|
+
includeComments: any;
|
|
6
|
+
dts: any;
|
|
7
|
+
useTabs?: boolean;
|
|
8
|
+
}): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default function generateFlatExportLines({ flatExports, exportRoots, includeComments, dts, useTabs }: {
|
|
2
|
-
flatExports: any;
|
|
3
|
-
exportRoots: any;
|
|
4
|
-
includeComments: any;
|
|
5
|
-
dts: any;
|
|
6
|
-
useTabs?: boolean;
|
|
7
|
-
}): string;
|
|
1
|
+
export default function generateFlatExportLines({ flatExports, exportRoots, includeComments, dts, useTabs }: {
|
|
2
|
+
flatExports: any;
|
|
3
|
+
exportRoots: any;
|
|
4
|
+
includeComments: any;
|
|
5
|
+
dts: any;
|
|
6
|
+
useTabs?: boolean;
|
|
7
|
+
}): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default function generateImportStatements({ fileDataList, dts, src }: {
|
|
2
|
-
fileDataList: any;
|
|
3
|
-
dts: any;
|
|
4
|
-
src: any;
|
|
5
|
-
}): string;
|
|
1
|
+
export default function generateImportStatements({ fileDataList, dts, src }: {
|
|
2
|
+
fileDataList: any;
|
|
3
|
+
dts: any;
|
|
4
|
+
src: any;
|
|
5
|
+
}): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default function generateNamedExports({ flatExports, exportRoots, nestedExports, dts, useTabs }: {
|
|
2
|
-
flatExports: any;
|
|
3
|
-
exportRoots: any;
|
|
4
|
-
nestedExports: any;
|
|
5
|
-
dts: any;
|
|
6
|
-
useTabs?: boolean;
|
|
7
|
-
}): string;
|
|
1
|
+
export default function generateNamedExports({ flatExports, exportRoots, nestedExports, dts, useTabs }: {
|
|
2
|
+
flatExports: any;
|
|
3
|
+
exportRoots: any;
|
|
4
|
+
nestedExports: any;
|
|
5
|
+
dts: any;
|
|
6
|
+
useTabs?: boolean;
|
|
7
|
+
}): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export default function generateNamespaceCode({ nsObj, indentLevel, includeComments, dts, useTabs }: {
|
|
2
|
-
nsObj: any;
|
|
3
|
-
indentLevel: any;
|
|
4
|
-
includeComments: any;
|
|
5
|
-
dts: any;
|
|
6
|
-
useTabs?: boolean;
|
|
7
|
-
}): string;
|
|
1
|
+
export default function generateNamespaceCode({ nsObj, indentLevel, includeComments, dts, useTabs }: {
|
|
2
|
+
nsObj: any;
|
|
3
|
+
indentLevel: any;
|
|
4
|
+
includeComments: any;
|
|
5
|
+
dts: any;
|
|
6
|
+
useTabs?: boolean;
|
|
7
|
+
}): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default function generateNamespaceExportLines({ nestedExports, includeComments, dts, useTabs }: {
|
|
2
|
-
nestedExports: any;
|
|
3
|
-
includeComments: any;
|
|
4
|
-
dts: any;
|
|
5
|
-
useTabs?: boolean;
|
|
6
|
-
}): string;
|
|
1
|
+
export default function generateNamespaceExportLines({ nestedExports, includeComments, dts, useTabs }: {
|
|
2
|
+
nestedExports: any;
|
|
3
|
+
includeComments: any;
|
|
4
|
+
dts: any;
|
|
5
|
+
useTabs?: boolean;
|
|
6
|
+
}): string;
|
package/types/uuid.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default uuid;
|
|
2
|
-
declare function uuid(): string;
|
|
1
|
+
export default uuid;
|
|
2
|
+
declare function uuid(): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default validateSchema;
|
|
2
|
-
declare function validateSchema(schema: any): boolean;
|
|
1
|
+
export default validateSchema;
|
|
2
|
+
declare function validateSchema(schema: any): boolean;
|