@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
package/build/build.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import build from '../src/build.js';
2
2
 
3
3
  build({
4
- src: './src',
5
- dest: './index.js',
6
- dts: false,
7
- ignore: [
8
- 'ignoreMe.js',
9
- 'ignoreFolder/*',
10
- //'namespaceExample/*',
11
- ],
4
+ src: './src',
5
+ dest: './index.js',
6
+ dts: false,
7
+ ignore: [
8
+ 'ignoreMe.js',
9
+ 'ignoreFolder/*',
10
+ //'namespaceExample/*',
11
+ ],
12
12
  });
13
13
 
14
14
  build({
15
- src: './schemas',
16
- dest: './schemas.js',
17
- dts: false
15
+ src: './schemas',
16
+ dest: './schemas.js',
17
+ dts: false
18
18
  });
@@ -1,11 +1,11 @@
1
1
  import build from '../src/build.js';
2
2
  build({
3
- src: './src',
4
- dest: './types/index.d.ts',
5
- dts: true,
6
- ignore: [
7
- 'ignoreMe.js',
8
- 'ignoreFolder/*',
9
- //'namespaceExample/*',
10
- ],
3
+ src: './src',
4
+ dest: './types/index.d.ts',
5
+ dts: true,
6
+ ignore: [
7
+ 'ignoreMe.js',
8
+ 'ignoreFolder/*',
9
+ //'namespaceExample/*',
10
+ ],
11
11
  });
@@ -0,0 +1,90 @@
1
+ export default [
2
+ // Here is where we fix "padding-line-between-statements"
3
+ {
4
+ rules: {
5
+ 'padding-line-between-statements': [
6
+ 'error',
7
+ // Insert a blank line **before** any block-like statement
8
+ {
9
+ blankLine: 'always',
10
+ prev: '*',
11
+ next: 'block-like'
12
+ },
13
+ // Insert a blank line **after** any block-like statement
14
+ {
15
+ blankLine: 'always',
16
+ prev: 'block-like',
17
+ next: '*'
18
+ },
19
+ // Keep the rest of your rules here as needed...
20
+ {
21
+ blankLine: 'always',
22
+ prev: '*',
23
+ next: 'function'
24
+ },
25
+ {
26
+ blankLine: 'always',
27
+ prev: 'function',
28
+ next: '*'
29
+ },
30
+ {
31
+ blankLine: 'always',
32
+ prev: '*',
33
+ next: 'throw'
34
+ }
35
+ ],
36
+ 'padded-blocks': [
37
+ 'error',
38
+ {
39
+ blocks: 'always',
40
+ classes: 'always',
41
+ switches: 'always'
42
+ }
43
+ ],
44
+
45
+ "object-curly-newline": [
46
+ "error",
47
+ {
48
+ ObjectExpression: {
49
+ minProperties: 2, // If object has 2+ props, break into multiple lines
50
+ multiline: true,
51
+ consistent: true
52
+ },
53
+ // You can also configure ImportDeclaration, ExportDeclaration, etc.
54
+ ObjectPattern: {
55
+ multiline: true,
56
+ minProperties: 2,
57
+ consistent: true
58
+ },
59
+ ImportDeclaration: {
60
+ multiline: true,
61
+ minProperties: 2
62
+ },
63
+ ExportDeclaration: {
64
+ multiline: true,
65
+ minProperties: 2
66
+ }
67
+ }
68
+ ],
69
+
70
+ // 2) If the object is multiline, put each property on its own line
71
+ "object-property-newline": [
72
+ "error",
73
+ {
74
+ allowAllPropertiesOnSameLine: false
75
+ }
76
+ ],
77
+
78
+ indent: [ "error", "tab", { "SwitchCase": 1 } ],
79
+ semi: [ "error", "always" ],
80
+ "arrow-parens": [ "error", "always" ],
81
+ "object-curly-spacing": [ "error", "always" ],
82
+ "array-bracket-spacing": [ "error", "always" ],
83
+ 'lines-between-class-members': [ 'error', 'always' ],
84
+ 'newline-after-var': [ 'error', 'always' ],
85
+ 'newline-before-return': 'error',
86
+ 'brace-style': [ 'error', '1tbs', { allowSingleLine: false } ],
87
+ "no-unreachable": "off"
88
+ }
89
+ }
90
+ ];
package/index.js CHANGED
@@ -1,137 +1,140 @@
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 _combineFiles from './src/combineFiles.js';
16
- import _convertBytes from './src/convertBytes.js';
17
- import _decrypt from './src/decrypt.js';
18
- import _each from './src/each.js';
19
- import _eachAsync from './src/eachAsync.js';
20
- import _encrypt from './src/encrypt.js';
21
- import _getAllFiles from './src/getAllFiles.js';
22
- import _ignoreFolder_ignoreMe from './src/ignoreFolder/ignoreMe.js';
23
- import _ignoreMe from './src/ignoreMe.js';
24
- import _isUUID from './src/isUUID.js';
25
- import _md5 from './src/md5.js';
26
- import _password_check from './src/password/check.js';
27
- import _password_hash from './src/password/hash.js';
28
- import _setLocalEnvs from './src/setLocalEnvs.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 _utils_shouldIgnore from './src/utils/shouldIgnore.js';
42
- import _uuid from './src/uuid.js';
43
- import _validateSchema from './src/validateSchema.js';
44
-
45
- export { _build as build };
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 { _ignoreMe as ignoreMe };
54
- export { _isUUID as isUUID };
55
- export { _md5 as md5 };
56
- export { _setLocalEnvs as setLocalEnvs };
57
- export { _thingType as thingType };
58
- export { _toPennies as toPennies };
59
- export { _uuid as uuid };
60
- export { _validateSchema as validateSchema };
61
-
62
- export default {
63
- /**
64
- * Builds a file from the specified source directory and writes it to the destination file.
65
- *
66
- * @param {Object} options - The options for the build process.
67
- * @param {string} [options.src='./src'] - The source directory to build from.
68
- * @param {string} [options.dest='./index.js'] - The destination file to write the built content to.
69
- * @param {boolean} [options.exportRoots=true] - Whether to export root files.
70
- * @param {string[]} [options.ignore=[]] - An array of file patterns to ignore.
71
- * @param {boolean} [options.includeComments=true] - Whether to include comments in the generated file.
72
- * @param {boolean} [options.dts=false] - Whether to generate TypeScript declaration files.
73
- * @returns {Promise<boolean>} A promise that resolves to true when the build is complete.
74
- */
75
- build: _build,
76
- combineFiles: _combineFiles,
77
- /**
78
- * Converts a given number of bytes into a more readable string format with appropriate units.
79
- *
80
- * @param {number} bytes - The number of bytes to convert.
81
- * @param {number} [precision=2] - The number of decimal places to include in the result.
82
- * @returns {string} The converted bytes in a string format with appropriate units.
83
- */
84
- convertBytes: _convertBytes,
85
- decrypt: _decrypt,
86
- /**
87
- * Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
88
- * The iteration stops if the callback returns `false`.
89
- *
90
- * @example each({ a: 1, b: 2 }, (value, key) => { console.log(value, key); });
91
- * @param {Object|Array} objectOrArray - The object or array to iterate over.
92
- * @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
93
- * @returns {void}
94
- */
95
- each: _each,
96
- eachAsync: _eachAsync,
97
- encrypt: _encrypt,
98
- getAllFiles: _getAllFiles,
99
- ignoreMe: _ignoreMe,
100
- isUUID: _isUUID,
101
- md5: _md5,
102
- setLocalEnvs: _setLocalEnvs,
103
- thingType: _thingType,
104
- toPennies: _toPennies,
105
- uuid: _uuid,
106
- validateSchema: _validateSchema,
107
- clean: {
108
- array: _clean_array,
109
- boolean: _clean_boolean,
110
- integer: _clean_integer,
111
- number: _clean_number,
112
- object: _clean_object,
113
- string: _clean_string,
114
- timestamp: _clean_timestamp,
115
- uuid: _clean_uuid,
116
- },
117
- ignoreFolder: {
118
- ignoreMe: _ignoreFolder_ignoreMe,
119
- },
120
- password: {
121
- check: _password_check,
122
- hash: _password_hash,
123
- },
124
- utils: {
125
- buildExportsTree: _utils_buildExportsTree,
126
- buildFileDataList: _utils_buildFileDataList,
127
- clean: _utils_clean,
128
- extractJSDocComment: _utils_extractJSDocComment,
129
- generateFile: _utils_generateFile,
130
- generateFlatExportLines: _utils_generateFlatExportLines,
131
- generateImportStatements: _utils_generateImportStatements,
132
- generateNamedExports: _utils_generateNamedExports,
133
- generateNamespaceCode: _utils_generateNamespaceCode,
134
- generateNamespaceExportLines: _utils_generateNamespaceExportLines,
135
- shouldIgnore: _utils_shouldIgnore,
136
- },
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 _ignoreFolder_ignoreMe from './src/ignoreFolder/ignoreMe.js';
24
+ import _ignoreMe from './src/ignoreMe.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 _setLocalEnvs from './src/setLocalEnvs.js';
30
+ import _thingType from './src/thingType.js';
31
+ import _toPennies from './src/toPennies.js';
32
+ import _utils_buildExportsTree from './src/utils/buildExportsTree.js';
33
+ import _utils_buildFileDataList from './src/utils/buildFileDataList.js';
34
+ import _utils_clean from './src/utils/clean.js';
35
+ import _utils_extractJSDocComment from './src/utils/extractJSDocComment.js';
36
+ import _utils_generateFile from './src/utils/generateFile.js';
37
+ import _utils_generateFlatExportLines from './src/utils/generateFlatExportLines.js';
38
+ import _utils_generateImportStatements from './src/utils/generateImportStatements.js';
39
+ import _utils_generateNamedExports from './src/utils/generateNamedExports.js';
40
+ import _utils_generateNamespaceCode from './src/utils/generateNamespaceCode.js';
41
+ import _utils_generateNamespaceExportLines from './src/utils/generateNamespaceExportLines.js';
42
+ import _utils_shouldIgnore from './src/utils/shouldIgnore.js';
43
+ import _uuid from './src/uuid.js';
44
+ import _validateSchema from './src/validateSchema.js';
45
+
46
+ export { _build as build };
47
+ export { _collectImports as collectImports };
48
+ export { _combineFiles as combineFiles };
49
+ export { _convertBytes as convertBytes };
50
+ export { _decrypt as decrypt };
51
+ export { _each as each };
52
+ export { _eachAsync as eachAsync };
53
+ export { _encrypt as encrypt };
54
+ export { _getAllFiles as getAllFiles };
55
+ export { _ignoreMe as ignoreMe };
56
+ export { _isUUID as isUUID };
57
+ export { _md5 as md5 };
58
+ export { _setLocalEnvs as setLocalEnvs };
59
+ export { _thingType as thingType };
60
+ export { _toPennies as toPennies };
61
+ export { _uuid as uuid };
62
+ export { _validateSchema as validateSchema };
63
+
64
+ export default {
65
+ /**
66
+ * Builds a file from the specified source directory and writes it to the destination file.
67
+ *
68
+ * @param {Object} options - The options for the build process.
69
+ * @param {string} [options.src='./src'] - The source directory to build from.
70
+ * @param {string} [options.dest='./index.js'] - The destination file to write the built content to.
71
+ * @param {boolean} [options.exportRoots=true] - Whether to export root files.
72
+ * @param {string[]} [options.ignore=[]] - An array of file patterns to ignore.
73
+ * @param {boolean} [options.includeComments=true] - Whether to include comments in the generated file.
74
+ * @param {boolean} [options.dts=false] - Whether to generate TypeScript declaration files.
75
+ * @returns {Promise<boolean>} A promise that resolves to true when the build is complete.
76
+ */
77
+ build: _build,
78
+ collectImports: _collectImports,
79
+ combineFiles: _combineFiles,
80
+ /**
81
+ * Converts a given number of bytes into a more readable string format with appropriate units.
82
+ *
83
+ * @param {number} bytes - The number of bytes to convert.
84
+ * @param {number} [precision=2] - The number of decimal places to include in the result.
85
+ * @returns {string} The converted bytes in a string format with appropriate units.
86
+ */
87
+ convertBytes: _convertBytes,
88
+ decrypt: _decrypt,
89
+ /**
90
+ * Iterates over elements of an array or properties of an object, invoking a callback for each element/property.
91
+ * The iteration stops if the callback returns `false`.
92
+ *
93
+ * @example each({ a: 1, b: 2 }, (value, key) => { console.log(value, key); });
94
+ * @param {Object|Array} objectOrArray - The object or array to iterate over.
95
+ * @param {Function} callback - The function to invoke per iteration. It is invoked with two arguments: (value, key/index).
96
+ * @returns {void}
97
+ */
98
+ each: _each,
99
+ eachAsync: _eachAsync,
100
+ encrypt: _encrypt,
101
+ getAllFiles: _getAllFiles,
102
+ ignoreMe: _ignoreMe,
103
+ isUUID: _isUUID,
104
+ md5: _md5,
105
+ setLocalEnvs: _setLocalEnvs,
106
+ thingType: _thingType,
107
+ toPennies: _toPennies,
108
+ uuid: _uuid,
109
+ validateSchema: _validateSchema,
110
+ clean: {
111
+ array: _clean_array,
112
+ boolean: _clean_boolean,
113
+ integer: _clean_integer,
114
+ number: _clean_number,
115
+ object: _clean_object,
116
+ string: _clean_string,
117
+ timestamp: _clean_timestamp,
118
+ uuid: _clean_uuid,
119
+ },
120
+ ignoreFolder: {
121
+ ignoreMe: _ignoreFolder_ignoreMe,
122
+ },
123
+ password: {
124
+ check: _password_check,
125
+ hash: _password_hash,
126
+ },
127
+ utils: {
128
+ buildExportsTree: _utils_buildExportsTree,
129
+ buildFileDataList: _utils_buildFileDataList,
130
+ clean: _utils_clean,
131
+ extractJSDocComment: _utils_extractJSDocComment,
132
+ generateFile: _utils_generateFile,
133
+ generateFlatExportLines: _utils_generateFlatExportLines,
134
+ generateImportStatements: _utils_generateImportStatements,
135
+ generateNamedExports: _utils_generateNamedExports,
136
+ generateNamespaceCode: _utils_generateNamespaceCode,
137
+ generateNamespaceExportLines: _utils_generateNamespaceExportLines,
138
+ shouldIgnore: _utils_shouldIgnore,
139
+ },
137
140
  };
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
- "name": "@awesomeness-js/utils",
3
- "version": "1.0.23",
4
- "description": "Awesomeness - Utils",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/awesomeness-js/utils.git"
8
- },
9
- "scripts": {
10
- "prebuild": "node ./build/build.js",
11
- "build": "tsc && npm run postBuild",
12
- "postBuild": "node ./build/postBuild.js",
13
- "test": "vitest"
14
- },
15
- "type": "module",
16
- "types": "./types/index.d.ts",
17
- "main": "index.js",
18
- "author": "Scott Forte",
19
- "license": "MIT",
20
- "publishConfig": {
21
- "access": "public"
22
- },
23
- "devDependencies": {
24
- "vitest": "^3.0.9"
25
- }
26
- }
2
+ "name": "@awesomeness-js/utils",
3
+ "version": "1.0.25",
4
+ "description": "Awesomeness - Utils",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/awesomeness-js/utils.git"
8
+ },
9
+ "scripts": {
10
+ "prebuild": "node ./build/build.js",
11
+ "build": "tsc && npm run postBuild",
12
+ "postBuild": "node ./build/postBuild.js",
13
+ "test": "vitest"
14
+ },
15
+ "type": "module",
16
+ "types": "./types/index.d.ts",
17
+ "main": "index.js",
18
+ "author": "Scott Forte",
19
+ "license": "MIT",
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "devDependencies": {
24
+ "vitest": "^3.0.9"
25
+ }
26
+ }
@@ -5,7 +5,11 @@ const properties = {
5
5
  exampleId: {
6
6
  type: 'uuid',
7
7
  description: 'the id of the vertex',
8
- default: () => { return uuid(); },
8
+ default: () => {
9
+
10
+ return uuid();
11
+
12
+ },
9
13
  example: '00000000-0000-0000-0000-000000000000',
10
14
  immutable: true,
11
15
  required: true
@@ -5,7 +5,11 @@ const properties = {
5
5
  exampleId: {
6
6
  type: 'uuid',
7
7
  description: 'the id of the vertex',
8
- default: () => { return uuid(); },
8
+ default: () => {
9
+
10
+ return uuid();
11
+
12
+ },
9
13
  example: '00000000-0000-0000-0000-000000000000',
10
14
  immutable: true,
11
15
  required: true
package/schemas.js CHANGED
@@ -1,15 +1,15 @@
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
- export default {
13
- schema1: _schema1,
14
- 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
+ export default {
13
+ schema1: _schema1,
14
+ schema2: _schema2,
15
15
  };
package/src/build.js CHANGED
@@ -14,15 +14,19 @@ import { writeFileSync } from 'fs';
14
14
  import generateFile from './utils/generateFile.js';
15
15
 
16
16
  async function build({
17
- src = './src',
18
- dest = './index.js',
19
- exportRoots = true,
20
- ignore = [],
21
- includeComments = true,
22
- dts = false
17
+ src = './src',
18
+ dest = './index.js',
19
+ exportRoots = true,
20
+ ignore = [],
21
+ includeComments = true,
22
+ dts = false,
23
+ useTabs = true
23
24
  } = {}) {
24
- writeFileSync(dest, generateFile(src, exportRoots, ignore, includeComments, dts));
25
- return true;
25
+
26
+ writeFileSync(dest, generateFile(src, exportRoots, ignore, includeComments, dts, useTabs));
27
+
28
+ return true;
29
+
26
30
  }
27
31
 
28
32
  export default build;
@@ -1,22 +1,32 @@
1
1
  export default function cleanBoolean(x, {
2
- required = false
2
+ required = false
3
3
  } = {}){
4
4
 
5
- try {
6
-
7
- if(x !== true && x !== false){
8
- throw {
9
- message: `Invalid boolean value "${x}"`,
10
- }
11
- }
12
-
13
- return x;
14
-
15
- } catch (e) {
16
-
17
- if(required) { throw e; } else { return null; }
18
-
19
- }
20
-
5
+ try {
6
+
7
+ if(x !== true && x !== false){
8
+
9
+ throw {
10
+ message: `Invalid boolean value "${x}"`,
11
+ };
12
+
13
+ }
14
+
15
+ return x;
16
+
17
+ } catch (e) {
18
+
19
+ if(required) {
20
+
21
+ throw e;
22
+
23
+ } else {
24
+
25
+ return null;
26
+
27
+ }
28
+
29
+ }
30
+
21
31
  }
22
32