@awesomeness-js/utils 1.1.3 → 1.1.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/README.md +1 -3
- package/build/build.js +0 -6
- package/index.js +138 -141
- package/package.json +1 -1
- package/schemas.js +15 -15
- package/src/build.js +3 -67
- package/src/clean/string.js +50 -1
- package/src/wait.js +3 -0
- package/types/build.d.ts +10 -13
- package/types/clean/array.d.ts +2 -2
- package/types/clean/object.d.ts +2 -2
- package/types/clean/string.d.ts +8 -8
- package/types/collectImports.d.ts +6 -6
- package/types/combineFiles.d.ts +8 -8
- package/types/index.d.ts +141 -144
- package/types/shouldIgnore.d.ts +1 -1
- package/types/utils/buildFileDataList.d.ts +12 -12
- package/types/utils/clean.d.ts +19 -19
- 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/src/utils/writeHotWrapper.js +0 -42
- package/types/clean/thing.d.ts +0 -2
- package/types/hashPassword.d.ts +0 -1
- package/types/utils/shouldIgnore.d.ts +0 -1
- package/types/utils/writeHotWrapper.d.ts +0 -4
- package/types/validatePassword.d.ts +0 -1
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ Webpack is a great bundler, but it’s not suited for building a structured expo
|
|
|
36
36
|
✔ **Simple and predictable**—You control how exports are structured.
|
|
37
37
|
✔ **Namespace support**—Uses folder structure to organize functions logically.
|
|
38
38
|
✔ **Minimal setup** — one line to generate your exports
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
|
|
41
41
|
> Uses `chokidar` under the hood for reliable cross-platform file watching.
|
|
42
42
|
|
|
@@ -75,7 +75,6 @@ await build({
|
|
|
75
75
|
dest: './api.js',
|
|
76
76
|
includeComments: true,
|
|
77
77
|
useTabs: true,
|
|
78
|
-
hotModuleReload: true // Enable hot reload for dev
|
|
79
78
|
});
|
|
80
79
|
```
|
|
81
80
|
|
|
@@ -171,5 +170,4 @@ If that makes you hard, you’re in the right place.
|
|
|
171
170
|
✱ disclaimer... *Kinda zero dependencies.*
|
|
172
171
|
Zero **prod** dependencies.
|
|
173
172
|
> dev dependencies:
|
|
174
|
-
> `chokidar` for hot module reloading (HMR)
|
|
175
173
|
> `vitest` for testing
|
package/build/build.js
CHANGED
package/index.js
CHANGED
|
@@ -1,97 +1,95 @@
|
|
|
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_integer from './src/clean/integer.js';
|
|
10
|
-
import _clean_number from './src/clean/number.js';
|
|
11
|
-
import _clean_object from './src/clean/object.js';
|
|
12
|
-
import _clean_string from './src/clean/string.js';
|
|
13
|
-
import _clean_timestamp from './src/clean/timestamp.js';
|
|
14
|
-
import _clean_uuid from './src/clean/uuid.js';
|
|
15
|
-
import _collectImports from './src/collectImports.js';
|
|
16
|
-
import _combineFiles from './src/combineFiles.js';
|
|
17
|
-
import _convertBytes from './src/convertBytes.js';
|
|
18
|
-
import _decrypt from './src/decrypt.js';
|
|
19
|
-
import _each from './src/each.js';
|
|
20
|
-
import _eachAsync from './src/eachAsync.js';
|
|
21
|
-
import _encrypt from './src/encrypt.js';
|
|
22
|
-
import _getAllFiles from './src/getAllFiles.js';
|
|
23
|
-
import _isUUID from './src/isUUID.js';
|
|
24
|
-
import _md5 from './src/md5.js';
|
|
25
|
-
import _password_check from './src/password/check.js';
|
|
26
|
-
import _password_hash from './src/password/hash.js';
|
|
27
|
-
import _setLocalEnvs from './src/setLocalEnvs.js';
|
|
28
|
-
import _shouldIgnore from './src/shouldIgnore.js';
|
|
29
|
-
import _thingType from './src/thingType.js';
|
|
30
|
-
import _toPennies from './src/toPennies.js';
|
|
31
|
-
import _utils_buildExportsTree from './src/utils/buildExportsTree.js';
|
|
32
|
-
import _utils_buildFileDataList from './src/utils/buildFileDataList.js';
|
|
33
|
-
import _utils_clean from './src/utils/clean.js';
|
|
34
|
-
import _utils_extractJSDocComment from './src/utils/extractJSDocComment.js';
|
|
35
|
-
import _utils_generateFile from './src/utils/generateFile.js';
|
|
36
|
-
import _utils_generateFlatExportLines from './src/utils/generateFlatExportLines.js';
|
|
37
|
-
import _utils_generateImportStatements from './src/utils/generateImportStatements.js';
|
|
38
|
-
import _utils_generateNamedExports from './src/utils/generateNamedExports.js';
|
|
39
|
-
import _utils_generateNamespaceCode from './src/utils/generateNamespaceCode.js';
|
|
40
|
-
import _utils_generateNamespaceExportLines from './src/utils/generateNamespaceExportLines.js';
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export {
|
|
46
|
-
export {
|
|
47
|
-
export {
|
|
48
|
-
export {
|
|
49
|
-
export {
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
52
|
-
export {
|
|
53
|
-
export {
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export {
|
|
57
|
-
export {
|
|
58
|
-
export {
|
|
59
|
-
export {
|
|
60
|
-
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
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_integer from './src/clean/integer.js';
|
|
10
|
+
import _clean_number from './src/clean/number.js';
|
|
11
|
+
import _clean_object from './src/clean/object.js';
|
|
12
|
+
import _clean_string from './src/clean/string.js';
|
|
13
|
+
import _clean_timestamp from './src/clean/timestamp.js';
|
|
14
|
+
import _clean_uuid from './src/clean/uuid.js';
|
|
15
|
+
import _collectImports from './src/collectImports.js';
|
|
16
|
+
import _combineFiles from './src/combineFiles.js';
|
|
17
|
+
import _convertBytes from './src/convertBytes.js';
|
|
18
|
+
import _decrypt from './src/decrypt.js';
|
|
19
|
+
import _each from './src/each.js';
|
|
20
|
+
import _eachAsync from './src/eachAsync.js';
|
|
21
|
+
import _encrypt from './src/encrypt.js';
|
|
22
|
+
import _getAllFiles from './src/getAllFiles.js';
|
|
23
|
+
import _isUUID from './src/isUUID.js';
|
|
24
|
+
import _md5 from './src/md5.js';
|
|
25
|
+
import _password_check from './src/password/check.js';
|
|
26
|
+
import _password_hash from './src/password/hash.js';
|
|
27
|
+
import _setLocalEnvs from './src/setLocalEnvs.js';
|
|
28
|
+
import _shouldIgnore from './src/shouldIgnore.js';
|
|
29
|
+
import _thingType from './src/thingType.js';
|
|
30
|
+
import _toPennies from './src/toPennies.js';
|
|
31
|
+
import _utils_buildExportsTree from './src/utils/buildExportsTree.js';
|
|
32
|
+
import _utils_buildFileDataList from './src/utils/buildFileDataList.js';
|
|
33
|
+
import _utils_clean from './src/utils/clean.js';
|
|
34
|
+
import _utils_extractJSDocComment from './src/utils/extractJSDocComment.js';
|
|
35
|
+
import _utils_generateFile from './src/utils/generateFile.js';
|
|
36
|
+
import _utils_generateFlatExportLines from './src/utils/generateFlatExportLines.js';
|
|
37
|
+
import _utils_generateImportStatements from './src/utils/generateImportStatements.js';
|
|
38
|
+
import _utils_generateNamedExports from './src/utils/generateNamedExports.js';
|
|
39
|
+
import _utils_generateNamespaceCode from './src/utils/generateNamespaceCode.js';
|
|
40
|
+
import _utils_generateNamespaceExportLines from './src/utils/generateNamespaceExportLines.js';
|
|
41
|
+
import _uuid from './src/uuid.js';
|
|
42
|
+
import _validateSchema from './src/validateSchema.js';
|
|
43
|
+
|
|
44
|
+
export { _build as build };
|
|
45
|
+
export { _collectImports as collectImports };
|
|
46
|
+
export { _combineFiles as combineFiles };
|
|
47
|
+
export { _convertBytes as convertBytes };
|
|
48
|
+
export { _decrypt as decrypt };
|
|
49
|
+
export { _each as each };
|
|
50
|
+
export { _eachAsync as eachAsync };
|
|
51
|
+
export { _encrypt as encrypt };
|
|
52
|
+
export { _getAllFiles as getAllFiles };
|
|
53
|
+
export { _isUUID as isUUID };
|
|
54
|
+
export { _md5 as md5 };
|
|
55
|
+
export { _setLocalEnvs as setLocalEnvs };
|
|
56
|
+
export { _shouldIgnore as shouldIgnore };
|
|
57
|
+
export { _thingType as thingType };
|
|
58
|
+
export { _toPennies as toPennies };
|
|
59
|
+
export { _uuid as uuid };
|
|
60
|
+
export { _validateSchema as validateSchema };
|
|
61
|
+
|
|
62
|
+
export const clean = {
|
|
63
|
+
array: _clean_array,
|
|
64
|
+
boolean: _clean_boolean,
|
|
65
|
+
integer: _clean_integer,
|
|
66
|
+
number: _clean_number,
|
|
67
|
+
object: _clean_object,
|
|
68
|
+
string: _clean_string,
|
|
69
|
+
timestamp: _clean_timestamp,
|
|
70
|
+
uuid: _clean_uuid
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const password = {
|
|
74
|
+
check: _password_check,
|
|
75
|
+
hash: _password_hash
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const utils = {
|
|
79
|
+
buildExportsTree: _utils_buildExportsTree,
|
|
80
|
+
buildFileDataList: _utils_buildFileDataList,
|
|
81
|
+
clean: _utils_clean,
|
|
82
|
+
extractJSDocComment: _utils_extractJSDocComment,
|
|
83
|
+
generateFile: _utils_generateFile,
|
|
84
|
+
generateFlatExportLines: _utils_generateFlatExportLines,
|
|
85
|
+
generateImportStatements: _utils_generateImportStatements,
|
|
86
|
+
generateNamedExports: _utils_generateNamedExports,
|
|
87
|
+
generateNamespaceCode: _utils_generateNamespaceCode,
|
|
88
|
+
generateNamespaceExportLines: _utils_generateNamespaceExportLines
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
export default {
|
|
95
93
|
/**
|
|
96
94
|
* Builds a file from the specified source directory and writes it to the destination file.
|
|
97
95
|
*
|
|
@@ -103,19 +101,19 @@ export default {
|
|
|
103
101
|
* @param {boolean} [options.includeComments=true] - Whether to include comments in the generated file.
|
|
104
102
|
* @param {boolean} [options.dts=false] - Whether to generate TypeScript declaration files.
|
|
105
103
|
* @returns {Promise<boolean>} A promise that resolves to true when the build is complete.
|
|
106
|
-
*/
|
|
107
|
-
build: _build,
|
|
108
|
-
collectImports: _collectImports,
|
|
109
|
-
combineFiles: _combineFiles,
|
|
104
|
+
*/
|
|
105
|
+
build: _build,
|
|
106
|
+
collectImports: _collectImports,
|
|
107
|
+
combineFiles: _combineFiles,
|
|
110
108
|
/**
|
|
111
109
|
* Converts a given number of bytes into a more readable string format with appropriate units.
|
|
112
110
|
*
|
|
113
111
|
* @param {number} bytes - The number of bytes to convert.
|
|
114
112
|
* @param {number} [precision=2] - The number of decimal places to include in the result.
|
|
115
113
|
* @returns {string} The converted bytes in a string format with appropriate units.
|
|
116
|
-
*/
|
|
117
|
-
convertBytes: _convertBytes,
|
|
118
|
-
decrypt: _decrypt,
|
|
114
|
+
*/
|
|
115
|
+
convertBytes: _convertBytes,
|
|
116
|
+
decrypt: _decrypt,
|
|
119
117
|
/**
|
|
120
118
|
* Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
|
|
121
119
|
* The iteration stops if the callback returns `false`.
|
|
@@ -124,44 +122,43 @@ export default {
|
|
|
124
122
|
* @param {Object|Array} objectOrArray - The object or array to iterate over.
|
|
125
123
|
* @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
|
|
126
124
|
* @returns {void}
|
|
127
|
-
*/
|
|
128
|
-
each: _each,
|
|
129
|
-
eachAsync: _eachAsync,
|
|
130
|
-
encrypt: _encrypt,
|
|
131
|
-
getAllFiles: _getAllFiles,
|
|
132
|
-
isUUID: _isUUID,
|
|
133
|
-
md5: _md5,
|
|
134
|
-
setLocalEnvs: _setLocalEnvs,
|
|
135
|
-
shouldIgnore: _shouldIgnore,
|
|
136
|
-
thingType: _thingType,
|
|
137
|
-
toPennies: _toPennies,
|
|
138
|
-
uuid: _uuid,
|
|
139
|
-
validateSchema: _validateSchema,
|
|
140
|
-
clean: {
|
|
141
|
-
array: _clean_array,
|
|
142
|
-
boolean: _clean_boolean,
|
|
143
|
-
integer: _clean_integer,
|
|
144
|
-
number: _clean_number,
|
|
145
|
-
object: _clean_object,
|
|
146
|
-
string: _clean_string,
|
|
147
|
-
timestamp: _clean_timestamp,
|
|
148
|
-
uuid: _clean_uuid,
|
|
149
|
-
},
|
|
150
|
-
password: {
|
|
151
|
-
check: _password_check,
|
|
152
|
-
hash: _password_hash,
|
|
153
|
-
},
|
|
154
|
-
utils: {
|
|
155
|
-
buildExportsTree: _utils_buildExportsTree,
|
|
156
|
-
buildFileDataList: _utils_buildFileDataList,
|
|
157
|
-
clean: _utils_clean,
|
|
158
|
-
extractJSDocComment: _utils_extractJSDocComment,
|
|
159
|
-
generateFile: _utils_generateFile,
|
|
160
|
-
generateFlatExportLines: _utils_generateFlatExportLines,
|
|
161
|
-
generateImportStatements: _utils_generateImportStatements,
|
|
162
|
-
generateNamedExports: _utils_generateNamedExports,
|
|
163
|
-
generateNamespaceCode: _utils_generateNamespaceCode,
|
|
164
|
-
generateNamespaceExportLines: _utils_generateNamespaceExportLines,
|
|
165
|
-
|
|
166
|
-
},
|
|
125
|
+
*/
|
|
126
|
+
each: _each,
|
|
127
|
+
eachAsync: _eachAsync,
|
|
128
|
+
encrypt: _encrypt,
|
|
129
|
+
getAllFiles: _getAllFiles,
|
|
130
|
+
isUUID: _isUUID,
|
|
131
|
+
md5: _md5,
|
|
132
|
+
setLocalEnvs: _setLocalEnvs,
|
|
133
|
+
shouldIgnore: _shouldIgnore,
|
|
134
|
+
thingType: _thingType,
|
|
135
|
+
toPennies: _toPennies,
|
|
136
|
+
uuid: _uuid,
|
|
137
|
+
validateSchema: _validateSchema,
|
|
138
|
+
clean: {
|
|
139
|
+
array: _clean_array,
|
|
140
|
+
boolean: _clean_boolean,
|
|
141
|
+
integer: _clean_integer,
|
|
142
|
+
number: _clean_number,
|
|
143
|
+
object: _clean_object,
|
|
144
|
+
string: _clean_string,
|
|
145
|
+
timestamp: _clean_timestamp,
|
|
146
|
+
uuid: _clean_uuid,
|
|
147
|
+
},
|
|
148
|
+
password: {
|
|
149
|
+
check: _password_check,
|
|
150
|
+
hash: _password_hash,
|
|
151
|
+
},
|
|
152
|
+
utils: {
|
|
153
|
+
buildExportsTree: _utils_buildExportsTree,
|
|
154
|
+
buildFileDataList: _utils_buildFileDataList,
|
|
155
|
+
clean: _utils_clean,
|
|
156
|
+
extractJSDocComment: _utils_extractJSDocComment,
|
|
157
|
+
generateFile: _utils_generateFile,
|
|
158
|
+
generateFlatExportLines: _utils_generateFlatExportLines,
|
|
159
|
+
generateImportStatements: _utils_generateImportStatements,
|
|
160
|
+
generateNamedExports: _utils_generateNamedExports,
|
|
161
|
+
generateNamespaceCode: _utils_generateNamespaceCode,
|
|
162
|
+
generateNamespaceExportLines: _utils_generateNamespaceExportLines,
|
|
163
|
+
},
|
|
167
164
|
};
|
package/package.json
CHANGED
package/schemas.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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 _schema1 from './schemas/schema1.js';
|
|
7
|
-
import _schema2 from './schemas/schema2.js';
|
|
8
|
-
|
|
9
|
-
export { _schema1 as schema1 };
|
|
10
|
-
export { _schema2 as schema2 };
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
schema1: _schema1,
|
|
15
|
-
schema2: _schema2,
|
|
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 _schema1 from './schemas/schema1.js';
|
|
7
|
+
import _schema2 from './schemas/schema2.js';
|
|
8
|
+
|
|
9
|
+
export { _schema1 as schema1 };
|
|
10
|
+
export { _schema2 as schema2 };
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
schema1: _schema1,
|
|
15
|
+
schema2: _schema2,
|
|
16
16
|
};
|
package/src/build.js
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { writeFileSync } from 'fs';
|
|
14
14
|
import generateFile from './utils/generateFile.js';
|
|
15
|
-
import writeHotWrapper from './utils/writeHotWrapper.js';
|
|
16
15
|
|
|
17
16
|
async function build({
|
|
18
17
|
src = './src',
|
|
@@ -22,9 +21,6 @@ async function build({
|
|
|
22
21
|
includeComments = true,
|
|
23
22
|
dts = false,
|
|
24
23
|
useTabs = true,
|
|
25
|
-
hotModuleReload = false,
|
|
26
|
-
hotCallback = null,
|
|
27
|
-
hotSource = './hot-source.js' // generated only when hot is enabled
|
|
28
24
|
} = {}) {
|
|
29
25
|
|
|
30
26
|
const gen = () => generateFile({
|
|
@@ -36,70 +32,10 @@ async function build({
|
|
|
36
32
|
useTabs
|
|
37
33
|
});
|
|
38
34
|
|
|
39
|
-
const buildHot = () => {
|
|
40
35
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// 2) ensure index.js is a hot wrapper
|
|
46
|
-
writeHotWrapper({
|
|
47
|
-
dest,
|
|
48
|
-
hotSource
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
console.log(`[build] ensured hot wrapper ${dest}`);
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const buildCold = () => {
|
|
56
|
-
|
|
57
|
-
// single-file classic output (no second file)
|
|
58
|
-
writeFileSync(dest, gen());
|
|
59
|
-
console.log(`[build] wrote ${dest}`);
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
if (hotModuleReload) {
|
|
64
|
-
|
|
65
|
-
buildHot();
|
|
66
|
-
|
|
67
|
-
// watch only src; each change regenerates hot-source.js (wrapper auto-reloads it)
|
|
68
|
-
const chokidar = (await import('chokidar')).default;
|
|
69
|
-
|
|
70
|
-
console.log(`[build] watching ${src} for changes...`);
|
|
71
|
-
const watcher = chokidar.watch(src, {
|
|
72
|
-
ignoreInitial: true,
|
|
73
|
-
ignored: ignore
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
let timeout;
|
|
77
|
-
|
|
78
|
-
watcher.on('all', (_event, file) => {
|
|
79
|
-
|
|
80
|
-
clearTimeout(timeout);
|
|
81
|
-
timeout = setTimeout(() => {
|
|
82
|
-
|
|
83
|
-
console.log(`[build] change detected in ${file}, rebuilding payload...`);
|
|
84
|
-
writeFileSync(hotSource, gen());
|
|
85
|
-
|
|
86
|
-
if(typeof hotCallback === 'function') {
|
|
87
|
-
|
|
88
|
-
hotCallback(file);
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
console.log(`[build] ready.`);
|
|
93
|
-
|
|
94
|
-
}, 50);
|
|
95
|
-
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
} else {
|
|
99
|
-
|
|
100
|
-
buildCold();
|
|
101
|
-
|
|
102
|
-
}
|
|
36
|
+
// single-file classic output (no second file)
|
|
37
|
+
writeFileSync(dest, gen());
|
|
38
|
+
console.log(`[build] wrote ${dest}`);
|
|
103
39
|
|
|
104
40
|
return true;
|
|
105
41
|
|
package/src/clean/string.js
CHANGED
|
@@ -4,7 +4,9 @@ export default function cleanString(x, {
|
|
|
4
4
|
maxLength = false,
|
|
5
5
|
allowHtml = false,
|
|
6
6
|
allowScripts = false,
|
|
7
|
-
validValues = false
|
|
7
|
+
validValues = false,
|
|
8
|
+
format = false,
|
|
9
|
+
pattern = false
|
|
8
10
|
} = {}){
|
|
9
11
|
|
|
10
12
|
if(allowScripts && !allowHtml){
|
|
@@ -77,6 +79,53 @@ export default function cleanString(x, {
|
|
|
77
79
|
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
if(format === 'email') {
|
|
83
|
+
|
|
84
|
+
const emailRegex = /^(?!@)(?!.*@.*@)(?!.*\.\.)(?!\.\.)(?!.*-$)(?!.*-$)(?!.*\.-)[A-Za-z0-9._%+-]+(?:@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,})$/;
|
|
85
|
+
|
|
86
|
+
if(!emailRegex.test(x)) {
|
|
87
|
+
|
|
88
|
+
throw {
|
|
89
|
+
message: 'Invalid email format',
|
|
90
|
+
value: x
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if(pattern) {
|
|
98
|
+
|
|
99
|
+
// make sure pattern is itself a regex
|
|
100
|
+
if(!(pattern instanceof RegExp)) {
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
|
|
104
|
+
pattern = new RegExp(pattern);
|
|
105
|
+
|
|
106
|
+
} catch (e) {
|
|
107
|
+
|
|
108
|
+
throw {
|
|
109
|
+
message: 'Pattern is not a valid regular expression',
|
|
110
|
+
pattern,
|
|
111
|
+
value: x
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if(!pattern.test(x)) {
|
|
119
|
+
|
|
120
|
+
throw {
|
|
121
|
+
message: 'Invalid format',
|
|
122
|
+
value: x
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
}
|
|
128
|
+
|
|
80
129
|
return x;
|
|
81
130
|
|
|
82
131
|
} catch (e) {
|
package/src/wait.js
ADDED
package/types/build.d.ts
CHANGED
|
@@ -1,13 +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
|
-
|
|
11
|
-
hotCallback?: any;
|
|
12
|
-
hotSource?: string;
|
|
13
|
-
}): 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/array.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (arr: any, schema?: {}) => any[];
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: (arr: any, schema?: {}) => any[];
|
|
2
|
+
export default _default;
|
package/types/clean/object.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (obj: any, schema: any) => {};
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: (obj: any, schema: any) => {};
|
|
2
|
+
export default _default;
|
package/types/clean/string.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export default function cleanString(x: any, { required, minLength, maxLength, allowHtml, allowScripts, validValues }?: {
|
|
2
|
-
required?: boolean;
|
|
3
|
-
minLength?: boolean;
|
|
4
|
-
maxLength?: boolean;
|
|
5
|
-
allowHtml?: boolean;
|
|
6
|
-
allowScripts?: boolean;
|
|
7
|
-
validValues?: boolean;
|
|
8
|
-
}): string;
|
|
1
|
+
export default function cleanString(x: any, { required, minLength, maxLength, allowHtml, allowScripts, validValues }?: {
|
|
2
|
+
required?: boolean;
|
|
3
|
+
minLength?: boolean;
|
|
4
|
+
maxLength?: boolean;
|
|
5
|
+
allowHtml?: boolean;
|
|
6
|
+
allowScripts?: boolean;
|
|
7
|
+
validValues?: boolean;
|
|
8
|
+
}): 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/index.d.ts
CHANGED
|
@@ -1,97 +1,95 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is auto-generated by the build script.
|
|
3
|
-
* It consolidates API type declarations for use in the application.
|
|
4
|
-
* Do not edit manually.
|
|
5
|
-
*/
|
|
6
|
-
import type _build from './build';
|
|
7
|
-
import type _clean_array from './clean/array';
|
|
8
|
-
import type _clean_boolean from './clean/boolean';
|
|
9
|
-
import type _clean_integer from './clean/integer';
|
|
10
|
-
import type _clean_number from './clean/number';
|
|
11
|
-
import type _clean_object from './clean/object';
|
|
12
|
-
import type _clean_string from './clean/string';
|
|
13
|
-
import type _clean_timestamp from './clean/timestamp';
|
|
14
|
-
import type _clean_uuid from './clean/uuid';
|
|
15
|
-
import type _collectImports from './collectImports';
|
|
16
|
-
import type _combineFiles from './combineFiles';
|
|
17
|
-
import type _convertBytes from './convertBytes';
|
|
18
|
-
import type _decrypt from './decrypt';
|
|
19
|
-
import type _each from './each';
|
|
20
|
-
import type _eachAsync from './eachAsync';
|
|
21
|
-
import type _encrypt from './encrypt';
|
|
22
|
-
import type _getAllFiles from './getAllFiles';
|
|
23
|
-
import type _isUUID from './isUUID';
|
|
24
|
-
import type _md5 from './md5';
|
|
25
|
-
import type _password_check from './password/check';
|
|
26
|
-
import type _password_hash from './password/hash';
|
|
27
|
-
import type _setLocalEnvs from './setLocalEnvs';
|
|
28
|
-
import type _shouldIgnore from './shouldIgnore';
|
|
29
|
-
import type _thingType from './thingType';
|
|
30
|
-
import type _toPennies from './toPennies';
|
|
31
|
-
import type _utils_buildExportsTree from './utils/buildExportsTree';
|
|
32
|
-
import type _utils_buildFileDataList from './utils/buildFileDataList';
|
|
33
|
-
import type _utils_clean from './utils/clean';
|
|
34
|
-
import type _utils_extractJSDocComment from './utils/extractJSDocComment';
|
|
35
|
-
import type _utils_generateFile from './utils/generateFile';
|
|
36
|
-
import type _utils_generateFlatExportLines from './utils/generateFlatExportLines';
|
|
37
|
-
import type _utils_generateImportStatements from './utils/generateImportStatements';
|
|
38
|
-
import type _utils_generateNamedExports from './utils/generateNamedExports';
|
|
39
|
-
import type _utils_generateNamespaceCode from './utils/generateNamespaceCode';
|
|
40
|
-
import type _utils_generateNamespaceExportLines from './utils/generateNamespaceExportLines';
|
|
41
|
-
import type
|
|
42
|
-
import type
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export declare const
|
|
46
|
-
export declare const
|
|
47
|
-
export declare const
|
|
48
|
-
export declare const
|
|
49
|
-
export declare const
|
|
50
|
-
export declare const
|
|
51
|
-
export declare const
|
|
52
|
-
export declare const
|
|
53
|
-
export declare const
|
|
54
|
-
export declare const
|
|
55
|
-
export declare const
|
|
56
|
-
export declare const
|
|
57
|
-
export declare const
|
|
58
|
-
export declare const
|
|
59
|
-
export declare const
|
|
60
|
-
export declare const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
declare const _default: {
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the build script.
|
|
3
|
+
* It consolidates API type declarations for use in the application.
|
|
4
|
+
* Do not edit manually.
|
|
5
|
+
*/
|
|
6
|
+
import type _build from './build';
|
|
7
|
+
import type _clean_array from './clean/array';
|
|
8
|
+
import type _clean_boolean from './clean/boolean';
|
|
9
|
+
import type _clean_integer from './clean/integer';
|
|
10
|
+
import type _clean_number from './clean/number';
|
|
11
|
+
import type _clean_object from './clean/object';
|
|
12
|
+
import type _clean_string from './clean/string';
|
|
13
|
+
import type _clean_timestamp from './clean/timestamp';
|
|
14
|
+
import type _clean_uuid from './clean/uuid';
|
|
15
|
+
import type _collectImports from './collectImports';
|
|
16
|
+
import type _combineFiles from './combineFiles';
|
|
17
|
+
import type _convertBytes from './convertBytes';
|
|
18
|
+
import type _decrypt from './decrypt';
|
|
19
|
+
import type _each from './each';
|
|
20
|
+
import type _eachAsync from './eachAsync';
|
|
21
|
+
import type _encrypt from './encrypt';
|
|
22
|
+
import type _getAllFiles from './getAllFiles';
|
|
23
|
+
import type _isUUID from './isUUID';
|
|
24
|
+
import type _md5 from './md5';
|
|
25
|
+
import type _password_check from './password/check';
|
|
26
|
+
import type _password_hash from './password/hash';
|
|
27
|
+
import type _setLocalEnvs from './setLocalEnvs';
|
|
28
|
+
import type _shouldIgnore from './shouldIgnore';
|
|
29
|
+
import type _thingType from './thingType';
|
|
30
|
+
import type _toPennies from './toPennies';
|
|
31
|
+
import type _utils_buildExportsTree from './utils/buildExportsTree';
|
|
32
|
+
import type _utils_buildFileDataList from './utils/buildFileDataList';
|
|
33
|
+
import type _utils_clean from './utils/clean';
|
|
34
|
+
import type _utils_extractJSDocComment from './utils/extractJSDocComment';
|
|
35
|
+
import type _utils_generateFile from './utils/generateFile';
|
|
36
|
+
import type _utils_generateFlatExportLines from './utils/generateFlatExportLines';
|
|
37
|
+
import type _utils_generateImportStatements from './utils/generateImportStatements';
|
|
38
|
+
import type _utils_generateNamedExports from './utils/generateNamedExports';
|
|
39
|
+
import type _utils_generateNamespaceCode from './utils/generateNamespaceCode';
|
|
40
|
+
import type _utils_generateNamespaceExportLines from './utils/generateNamespaceExportLines';
|
|
41
|
+
import type _uuid from './uuid';
|
|
42
|
+
import type _validateSchema from './validateSchema';
|
|
43
|
+
|
|
44
|
+
export declare const build: typeof _build;
|
|
45
|
+
export declare const collectImports: typeof _collectImports;
|
|
46
|
+
export declare const combineFiles: typeof _combineFiles;
|
|
47
|
+
export declare const convertBytes: typeof _convertBytes;
|
|
48
|
+
export declare const decrypt: typeof _decrypt;
|
|
49
|
+
export declare const each: typeof _each;
|
|
50
|
+
export declare const eachAsync: typeof _eachAsync;
|
|
51
|
+
export declare const encrypt: typeof _encrypt;
|
|
52
|
+
export declare const getAllFiles: typeof _getAllFiles;
|
|
53
|
+
export declare const isUUID: typeof _isUUID;
|
|
54
|
+
export declare const md5: typeof _md5;
|
|
55
|
+
export declare const setLocalEnvs: typeof _setLocalEnvs;
|
|
56
|
+
export declare const shouldIgnore: typeof _shouldIgnore;
|
|
57
|
+
export declare const thingType: typeof _thingType;
|
|
58
|
+
export declare const toPennies: typeof _toPennies;
|
|
59
|
+
export declare const uuid: typeof _uuid;
|
|
60
|
+
export declare const validateSchema: typeof _validateSchema;
|
|
61
|
+
|
|
62
|
+
export declare const clean: {
|
|
63
|
+
array: typeof _clean_array;
|
|
64
|
+
boolean: typeof _clean_boolean;
|
|
65
|
+
integer: typeof _clean_integer;
|
|
66
|
+
number: typeof _clean_number;
|
|
67
|
+
object: typeof _clean_object;
|
|
68
|
+
string: typeof _clean_string;
|
|
69
|
+
timestamp: typeof _clean_timestamp;
|
|
70
|
+
uuid: typeof _clean_uuid;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export declare const password: {
|
|
74
|
+
check: typeof _password_check;
|
|
75
|
+
hash: typeof _password_hash;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export declare const utils: {
|
|
79
|
+
buildExportsTree: typeof _utils_buildExportsTree;
|
|
80
|
+
buildFileDataList: typeof _utils_buildFileDataList;
|
|
81
|
+
clean: typeof _utils_clean;
|
|
82
|
+
extractJSDocComment: typeof _utils_extractJSDocComment;
|
|
83
|
+
generateFile: typeof _utils_generateFile;
|
|
84
|
+
generateFlatExportLines: typeof _utils_generateFlatExportLines;
|
|
85
|
+
generateImportStatements: typeof _utils_generateImportStatements;
|
|
86
|
+
generateNamedExports: typeof _utils_generateNamedExports;
|
|
87
|
+
generateNamespaceCode: typeof _utils_generateNamespaceCode;
|
|
88
|
+
generateNamespaceExportLines: typeof _utils_generateNamespaceExportLines;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
declare const _default: {
|
|
95
93
|
/**
|
|
96
94
|
* Builds a file from the specified source directory and writes it to the destination file.
|
|
97
95
|
*
|
|
@@ -103,19 +101,19 @@ declare const _default: {
|
|
|
103
101
|
* @param {boolean} [options.includeComments=true] - Whether to include comments in the generated file.
|
|
104
102
|
* @param {boolean} [options.dts=false] - Whether to generate TypeScript declaration files.
|
|
105
103
|
* @returns {Promise<boolean>} A promise that resolves to true when the build is complete.
|
|
106
|
-
*/
|
|
107
|
-
build: typeof _build;
|
|
108
|
-
collectImports: typeof _collectImports;
|
|
109
|
-
combineFiles: typeof _combineFiles;
|
|
104
|
+
*/
|
|
105
|
+
build: typeof _build;
|
|
106
|
+
collectImports: typeof _collectImports;
|
|
107
|
+
combineFiles: typeof _combineFiles;
|
|
110
108
|
/**
|
|
111
109
|
* Converts a given number of bytes into a more readable string format with appropriate units.
|
|
112
110
|
*
|
|
113
111
|
* @param {number} bytes - The number of bytes to convert.
|
|
114
112
|
* @param {number} [precision=2] - The number of decimal places to include in the result.
|
|
115
113
|
* @returns {string} The converted bytes in a string format with appropriate units.
|
|
116
|
-
*/
|
|
117
|
-
convertBytes: typeof _convertBytes;
|
|
118
|
-
decrypt: typeof _decrypt;
|
|
114
|
+
*/
|
|
115
|
+
convertBytes: typeof _convertBytes;
|
|
116
|
+
decrypt: typeof _decrypt;
|
|
119
117
|
/**
|
|
120
118
|
* Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
|
|
121
119
|
* The iteration stops if the callback returns `false`.
|
|
@@ -124,46 +122,45 @@ declare const _default: {
|
|
|
124
122
|
* @param {Object|Array} objectOrArray - The object or array to iterate over.
|
|
125
123
|
* @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
|
|
126
124
|
* @returns {void}
|
|
127
|
-
*/
|
|
128
|
-
each: typeof _each;
|
|
129
|
-
eachAsync: typeof _eachAsync;
|
|
130
|
-
encrypt: typeof _encrypt;
|
|
131
|
-
getAllFiles: typeof _getAllFiles;
|
|
132
|
-
isUUID: typeof _isUUID;
|
|
133
|
-
md5: typeof _md5;
|
|
134
|
-
setLocalEnvs: typeof _setLocalEnvs;
|
|
135
|
-
shouldIgnore: typeof _shouldIgnore;
|
|
136
|
-
thingType: typeof _thingType;
|
|
137
|
-
toPennies: typeof _toPennies;
|
|
138
|
-
uuid: typeof _uuid;
|
|
139
|
-
validateSchema: typeof _validateSchema;
|
|
140
|
-
clean: {
|
|
141
|
-
array: typeof _clean_array,
|
|
142
|
-
boolean: typeof _clean_boolean,
|
|
143
|
-
integer: typeof _clean_integer,
|
|
144
|
-
number: typeof _clean_number,
|
|
145
|
-
object: typeof _clean_object,
|
|
146
|
-
string: typeof _clean_string,
|
|
147
|
-
timestamp: typeof _clean_timestamp,
|
|
148
|
-
uuid: typeof _clean_uuid,
|
|
149
|
-
},
|
|
150
|
-
password: {
|
|
151
|
-
check: typeof _password_check,
|
|
152
|
-
hash: typeof _password_hash,
|
|
153
|
-
},
|
|
154
|
-
utils: {
|
|
155
|
-
buildExportsTree: typeof _utils_buildExportsTree,
|
|
156
|
-
buildFileDataList: typeof _utils_buildFileDataList,
|
|
157
|
-
clean: typeof _utils_clean,
|
|
158
|
-
extractJSDocComment: typeof _utils_extractJSDocComment,
|
|
159
|
-
generateFile: typeof _utils_generateFile,
|
|
160
|
-
generateFlatExportLines: typeof _utils_generateFlatExportLines,
|
|
161
|
-
generateImportStatements: typeof _utils_generateImportStatements,
|
|
162
|
-
generateNamedExports: typeof _utils_generateNamedExports,
|
|
163
|
-
generateNamespaceCode: typeof _utils_generateNamespaceCode,
|
|
164
|
-
generateNamespaceExportLines: typeof _utils_generateNamespaceExportLines,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
export default _default;
|
|
125
|
+
*/
|
|
126
|
+
each: typeof _each;
|
|
127
|
+
eachAsync: typeof _eachAsync;
|
|
128
|
+
encrypt: typeof _encrypt;
|
|
129
|
+
getAllFiles: typeof _getAllFiles;
|
|
130
|
+
isUUID: typeof _isUUID;
|
|
131
|
+
md5: typeof _md5;
|
|
132
|
+
setLocalEnvs: typeof _setLocalEnvs;
|
|
133
|
+
shouldIgnore: typeof _shouldIgnore;
|
|
134
|
+
thingType: typeof _thingType;
|
|
135
|
+
toPennies: typeof _toPennies;
|
|
136
|
+
uuid: typeof _uuid;
|
|
137
|
+
validateSchema: typeof _validateSchema;
|
|
138
|
+
clean: {
|
|
139
|
+
array: typeof _clean_array,
|
|
140
|
+
boolean: typeof _clean_boolean,
|
|
141
|
+
integer: typeof _clean_integer,
|
|
142
|
+
number: typeof _clean_number,
|
|
143
|
+
object: typeof _clean_object,
|
|
144
|
+
string: typeof _clean_string,
|
|
145
|
+
timestamp: typeof _clean_timestamp,
|
|
146
|
+
uuid: typeof _clean_uuid,
|
|
147
|
+
},
|
|
148
|
+
password: {
|
|
149
|
+
check: typeof _password_check,
|
|
150
|
+
hash: typeof _password_hash,
|
|
151
|
+
},
|
|
152
|
+
utils: {
|
|
153
|
+
buildExportsTree: typeof _utils_buildExportsTree,
|
|
154
|
+
buildFileDataList: typeof _utils_buildFileDataList,
|
|
155
|
+
clean: typeof _utils_clean,
|
|
156
|
+
extractJSDocComment: typeof _utils_extractJSDocComment,
|
|
157
|
+
generateFile: typeof _utils_generateFile,
|
|
158
|
+
generateFlatExportLines: typeof _utils_generateFlatExportLines,
|
|
159
|
+
generateImportStatements: typeof _utils_generateImportStatements,
|
|
160
|
+
generateNamedExports: typeof _utils_generateNamedExports,
|
|
161
|
+
generateNamespaceCode: typeof _utils_generateNamespaceCode,
|
|
162
|
+
generateNamespaceExportLines: typeof _utils_generateNamespaceExportLines,
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
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;
|
|
@@ -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
|
+
}[];
|
package/types/utils/clean.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
export { cleanArray as array };
|
|
3
|
-
export { cleanObject as object };
|
|
4
|
-
export { cleanBoolean as boolean };
|
|
5
|
-
export { cleanInteger as integer };
|
|
6
|
-
export { cleanNumber as number };
|
|
7
|
-
export { cleanString as string };
|
|
8
|
-
export { cleanTimestamp as timestamp };
|
|
9
|
-
export { cleanUUID as uuid };
|
|
10
|
-
}
|
|
11
|
-
export default _default;
|
|
12
|
-
declare function cleanArray(arr: any, schema?: {}): any[];
|
|
13
|
-
declare function cleanObject(obj: any, schema: any): {};
|
|
14
|
-
import cleanBoolean from '../clean/boolean.js';
|
|
15
|
-
import cleanInteger from '../clean/integer.js';
|
|
16
|
-
import cleanNumber from '../clean/number.js';
|
|
17
|
-
import cleanString from '../clean/string.js';
|
|
18
|
-
import cleanTimestamp from '../clean/timestamp.js';
|
|
19
|
-
import cleanUUID from '../clean/uuid.js';
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { cleanArray as array };
|
|
3
|
+
export { cleanObject as object };
|
|
4
|
+
export { cleanBoolean as boolean };
|
|
5
|
+
export { cleanInteger as integer };
|
|
6
|
+
export { cleanNumber as number };
|
|
7
|
+
export { cleanString as string };
|
|
8
|
+
export { cleanTimestamp as timestamp };
|
|
9
|
+
export { cleanUUID as uuid };
|
|
10
|
+
}
|
|
11
|
+
export default _default;
|
|
12
|
+
declare function cleanArray(arr: any, schema?: {}): any[];
|
|
13
|
+
declare function cleanObject(obj: any, schema: any): {};
|
|
14
|
+
import cleanBoolean from '../clean/boolean.js';
|
|
15
|
+
import cleanInteger from '../clean/integer.js';
|
|
16
|
+
import cleanNumber from '../clean/number.js';
|
|
17
|
+
import cleanString from '../clean/string.js';
|
|
18
|
+
import cleanTimestamp from '../clean/timestamp.js';
|
|
19
|
+
import cleanUUID from '../clean/uuid.js';
|
|
@@ -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;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { writeFileSync } from 'node:fs';
|
|
2
|
-
|
|
3
|
-
export default function writeHotWrapper({
|
|
4
|
-
dest,
|
|
5
|
-
hotSource
|
|
6
|
-
}) {
|
|
7
|
-
|
|
8
|
-
const wrapper = `// auto-generated wrapper
|
|
9
|
-
import chokidar from 'chokidar';
|
|
10
|
-
import path from 'node:path';
|
|
11
|
-
import { pathToFileURL } from 'node:url';
|
|
12
|
-
|
|
13
|
-
let _default;
|
|
14
|
-
|
|
15
|
-
export { _default as default };
|
|
16
|
-
|
|
17
|
-
const target = path.resolve(${JSON.stringify(hotSource)});
|
|
18
|
-
|
|
19
|
-
async function reload() {
|
|
20
|
-
|
|
21
|
-
const mod = await import(\`\${pathToFileURL(target)}?t=\${Date.now()}\`);
|
|
22
|
-
|
|
23
|
-
_default = mod.default;
|
|
24
|
-
console.log('[hot] reloaded', target);
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
await reload();
|
|
29
|
-
|
|
30
|
-
let t;
|
|
31
|
-
|
|
32
|
-
chokidar.watch(target, { ignoreInitial: true }).on('all', () => {
|
|
33
|
-
|
|
34
|
-
clearTimeout(t);
|
|
35
|
-
t = setTimeout(() => reload().catch(err => console.error('[hot] failed:', err)), 50);
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
`;
|
|
39
|
-
|
|
40
|
-
writeFileSync(dest, wrapper);
|
|
41
|
-
|
|
42
|
-
}
|
package/types/clean/thing.d.ts
DELETED
package/types/hashPassword.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function hashPassword(password: any): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function shouldIgnore(filePath: any, ignorePatterns: any): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function validatePassword(password: any, storedHash: any): boolean;
|