js-build-tools 6.5.0 → 6.7.0

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 (169) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +762 -692
  3. package/babel.config.js +28 -28
  4. package/dist/build.js +75 -75
  5. package/dist/bundle.js +19 -19
  6. package/dist/bundleMinify.js +7 -7
  7. package/dist/compileReadme.js +4 -4
  8. package/dist/copyFiles.js +17 -17
  9. package/dist/copyFonts.js +4 -4
  10. package/dist/default.js +5 -5
  11. package/dist/dist.js +4 -4
  12. package/dist/distMinify.js +4 -4
  13. package/dist/docs.js +7 -7
  14. package/dist/images.js +4 -4
  15. package/dist/jsdocDocs.js +6 -6
  16. package/dist/lint.js +16 -16
  17. package/dist/partials/addToReadme.js +9 -9
  18. package/dist/partials/beginWatcher.js +4 -4
  19. package/dist/partials/clean.js +5 -5
  20. package/dist/partials/copyFor.js +9 -9
  21. package/dist/partials/distFor.js +6 -6
  22. package/dist/partials/distForSrc.js +5 -5
  23. package/dist/partials/distSeries.js +7 -7
  24. package/dist/partials/imagesFor.js +93 -56
  25. package/dist/partials/jsdocDocsFor.js +46 -46
  26. package/dist/partials/lintSource.js +51 -51
  27. package/dist/partials/loadPeer.js +99 -99
  28. package/dist/partials/loadPlaywright.js +14 -14
  29. package/dist/partials/minifyFor.js +20 -20
  30. package/dist/partials/neostandardLint.js +175 -175
  31. package/dist/partials/readmeTemplate.js +4 -4
  32. package/dist/partials/removeDirectory.js +11 -11
  33. package/dist/partials/resolveDocsMethod.js +6 -6
  34. package/dist/partials/runOnChange.js +31 -31
  35. package/dist/partials/sassFor.js +6 -6
  36. package/dist/partials/serveStatic.js +9 -9
  37. package/dist/partials/tsFor.js +32 -32
  38. package/dist/partials/typeDocsFor.js +57 -51
  39. package/dist/partials.js +176 -176
  40. package/dist/sourceLint.js +18 -18
  41. package/dist/test-helpers/isolateGulpCache.js +24 -24
  42. package/dist/test-helpers/setUp.js +4 -4
  43. package/dist/testFull.js +5 -5
  44. package/dist/testQuick.js +5 -5
  45. package/dist/typeDocs.js +5 -5
  46. package/dist/typeScript.js +4 -4
  47. package/dist/utilities/convertMjsFilesForDocs.js +12 -12
  48. package/dist/utilities/dotGet.js +54 -54
  49. package/dist/utilities/dotNotate.js +79 -79
  50. package/dist/utilities/dotSet.js +45 -45
  51. package/dist/utilities/esmNamedExportsToCjs.js +15 -15
  52. package/dist/utilities/getBundleConfigs.js +9 -9
  53. package/dist/utilities/isObject.js +6 -6
  54. package/dist/utilities/strAfter.js +7 -7
  55. package/dist/utilities/strBefore.js +7 -7
  56. package/dist/watchFull.js +4 -4
  57. package/dist/watchTest.js +4 -4
  58. package/functions/build.mjs +72 -72
  59. package/functions/build.test.mjs +763 -759
  60. package/functions/bundle.mjs +44 -44
  61. package/functions/bundle.test.mjs +219 -219
  62. package/functions/bundleMinify.mjs +16 -16
  63. package/functions/bundleMinify.test.mjs +37 -37
  64. package/functions/compileReadme.mjs +9 -9
  65. package/functions/compileReadme.test.mjs +18 -18
  66. package/functions/copyFiles.mjs +32 -32
  67. package/functions/copyFiles.test.mjs +78 -78
  68. package/functions/copyFonts.mjs +9 -9
  69. package/functions/copyFonts.test.mjs +32 -32
  70. package/functions/default.mjs +12 -12
  71. package/functions/default.test.mjs +33 -33
  72. package/functions/dist.mjs +8 -8
  73. package/functions/dist.test.mjs +44 -44
  74. package/functions/distMinify.mjs +9 -9
  75. package/functions/distMinify.test.mjs +15 -15
  76. package/functions/docs.mjs +13 -13
  77. package/functions/docs.test.mjs +45 -45
  78. package/functions/gulpConfigEntries.test.mjs +23 -23
  79. package/functions/images.mjs +8 -8
  80. package/functions/images.test.mjs +142 -142
  81. package/functions/jsdocDocs.mjs +10 -10
  82. package/functions/jsdocEsmExports.test.mjs +24 -24
  83. package/functions/lint.mjs +9 -9
  84. package/functions/partials/addToReadme.mjs +25 -25
  85. package/functions/partials/addToReadme.test.mjs +34 -34
  86. package/functions/partials/beginWatcher.mjs +9 -9
  87. package/functions/partials/beginWatcher.test.mjs +19 -19
  88. package/functions/partials/clean.mjs +13 -13
  89. package/functions/partials/clean.test.mjs +22 -22
  90. package/functions/partials/copyFor.mjs +15 -15
  91. package/functions/partials/copyFor.test.mjs +53 -53
  92. package/functions/partials/distFor.mjs +22 -22
  93. package/functions/partials/distFor.test.mjs +195 -195
  94. package/functions/partials/distForSrc.mjs +11 -11
  95. package/functions/partials/distForSrc.test.mjs +18 -18
  96. package/functions/partials/distSeries.mjs +21 -21
  97. package/functions/partials/distSeries.test.mjs +34 -34
  98. package/functions/partials/imagesFor.mjs +83 -50
  99. package/functions/partials/imagesFor.test.mjs +287 -229
  100. package/functions/partials/jsdocDocsFor.mjs +163 -152
  101. package/functions/partials/jsdocDocsFor.test.mjs +182 -152
  102. package/functions/partials/lintSource.mjs +41 -41
  103. package/functions/partials/loadPeer.mjs +76 -76
  104. package/functions/partials/loadPeer.test.mjs +58 -58
  105. package/functions/partials/loadPlaywright.mjs +23 -23
  106. package/functions/partials/loadPlaywright.test.mjs +70 -70
  107. package/functions/partials/minifyFor.mjs +15 -15
  108. package/functions/partials/minifyFor.test.mjs +49 -49
  109. package/functions/partials/neostandardLint.mjs +142 -142
  110. package/functions/partials/neostandardLint.test.mjs +131 -131
  111. package/functions/partials/readmeTemplate.mjs +12 -12
  112. package/functions/partials/readmeTemplate.test.mjs +34 -34
  113. package/functions/partials/removeDirectory.mjs +34 -34
  114. package/functions/partials/removeDirectory.test.mjs +72 -72
  115. package/functions/partials/resolveDocsMethod.mjs +10 -10
  116. package/functions/partials/resolveDocsMethod.test.mjs +33 -33
  117. package/functions/partials/runOnChange.mjs +54 -54
  118. package/functions/partials/runOnChange.test.mjs +95 -95
  119. package/functions/partials/sassFor.mjs +25 -25
  120. package/functions/partials/sassFor.test.mjs +81 -81
  121. package/functions/partials/serveStatic.mjs +47 -47
  122. package/functions/partials/serveStatic.test.mjs +71 -71
  123. package/functions/partials/tsFor.mjs +92 -92
  124. package/functions/partials/tsFor.test.mjs +88 -88
  125. package/functions/partials/typeDocsFor.mjs +231 -227
  126. package/functions/partials/typeDocsFor.test.mjs +263 -252
  127. package/functions/partials.mjs +31 -31
  128. package/functions/partials.test.mjs +7 -7
  129. package/functions/sass.mjs +4 -4
  130. package/functions/sass.test.mjs +31 -31
  131. package/functions/sourceLint.mjs +13 -13
  132. package/functions/sourceLint.test.mjs +166 -166
  133. package/functions/test-helpers/isolateGulpCache.mjs +16 -16
  134. package/functions/test-helpers/neostandardLintWithRealNeostandard.mjs +40 -40
  135. package/functions/test-helpers/setUp.mjs +100 -100
  136. package/functions/test-helpers/setUp.test.mjs +19 -19
  137. package/functions/testFull.mjs +17 -17
  138. package/functions/testFull.test.mjs +17 -17
  139. package/functions/testHelpers.mjs +10 -10
  140. package/functions/testHelpers.test.mjs +7 -7
  141. package/functions/testQuick.mjs +17 -17
  142. package/functions/testQuick.test.mjs +17 -17
  143. package/functions/typeDocs.mjs +9 -9
  144. package/functions/typeDocs.test.mjs +11 -11
  145. package/functions/typeScript.mjs +8 -8
  146. package/functions/typeScript.test.mjs +11 -11
  147. package/functions/utilities/convertMjsFilesForDocs.mjs +34 -34
  148. package/functions/utilities/convertMjsFilesForDocs.test.mjs +58 -58
  149. package/functions/utilities/dotGet.mjs +49 -49
  150. package/functions/utilities/dotNotate.mjs +73 -73
  151. package/functions/utilities/dotNotate.test.mjs +41 -41
  152. package/functions/utilities/dotSet.mjs +40 -40
  153. package/functions/utilities/esmNamedExportsToCjs.mjs +30 -30
  154. package/functions/utilities/esmNamedExportsToCjs.test.mjs +47 -47
  155. package/functions/utilities/getBundleConfigs.mjs +30 -30
  156. package/functions/utilities/isObject.mjs +8 -8
  157. package/functions/utilities/strAfter.mjs +12 -12
  158. package/functions/utilities/strBefore.mjs +12 -12
  159. package/functions/watchFull.mjs +9 -9
  160. package/functions/watchFull.test.mjs +41 -41
  161. package/functions/watchTest.mjs +10 -10
  162. package/functions/watchTest.test.mjs +49 -49
  163. package/gulp.config.js +4 -4
  164. package/gulp.config.mjs +344 -327
  165. package/gulpfile.base.js +51 -51
  166. package/gulpfile.base.mjs +29 -29
  167. package/jsdoc.base.js +16 -16
  168. package/jsdoc.esmExports.js +17 -17
  169. package/package.json +146 -145
@@ -1,25 +1,25 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isolateGulpCache = void 0;
7
- var _gulpCache = _interopRequireDefault(require("gulp-cache"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- /**
10
- * Give this test file its own gulp-cache folder, and return a function that clears only that folder. gulp-cache
11
- * otherwise keeps one cache in os.tmpdir() for every process, so a cache.clearAll() in one Jest worker could wipe it
12
- * while another worker's images task was still using it, and gulp-cache then silently dropped that worker's
13
- * images. Jest loads gulp-cache separately for each test file, so this only changes the copy that file uses.
14
- * @memberOf module:testHelpers
15
- * @param {string} name - Unique per test file, used in the cache folder name.
16
- * @returns {function(): Promise<void>} Clears this test file's cache.
17
- */
18
- const isolateGulpCache = name => {
19
- const fileCache = new _gulpCache.default.Cache({
20
- cacheDirName: `js-build-tools-test-${name}`
21
- });
22
- _gulpCache.default.defaultOptions.fileCache = fileCache;
23
- return () => new Promise((resolve, reject) => fileCache.clear(null, error => error ? reject(error) : resolve()));
24
- };
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isolateGulpCache = void 0;
7
+ var _gulpCache = _interopRequireDefault(require("gulp-cache"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ /**
10
+ * Give this test file its own gulp-cache folder, and return a function that clears only that folder. gulp-cache
11
+ * otherwise keeps one cache in os.tmpdir() for every process, so a cache.clearAll() in one Jest worker could wipe it
12
+ * while another worker's images task was still using it, and gulp-cache then silently dropped that worker's
13
+ * images. Jest loads gulp-cache separately for each test file, so this only changes the copy that file uses.
14
+ * @memberOf module:testHelpers
15
+ * @param {string} name - Unique per test file, used in the cache folder name.
16
+ * @returns {function(): Promise<void>} Clears this test file's cache.
17
+ */
18
+ const isolateGulpCache = name => {
19
+ const fileCache = new _gulpCache.default.Cache({
20
+ cacheDirName: `js-build-tools-test-${name}`
21
+ });
22
+ _gulpCache.default.defaultOptions.fileCache = fileCache;
23
+ return () => new Promise((resolve, reject) => fileCache.clear(null, error => error ? reject(error) : resolve()));
24
+ };
25
25
  exports.isolateGulpCache = isolateGulpCache;
@@ -58,10 +58,10 @@ function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e;
58
58
  let tempDir = 'test-temp/';
59
59
  let srcPath = `${tempDir}src`;
60
60
 
61
- /**
62
- * Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
63
- * @memberOf module:testHelpers
64
- * @param {string} testDir
61
+ /**
62
+ * Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
63
+ * @memberOf module:testHelpers
64
+ * @param {string} testDir
65
65
  */
66
66
  const setDefaults = (testDir = 'test-temp') => {
67
67
  tempDir = `${testDir}/`;
package/dist/testFull.js CHANGED
@@ -9,11 +9,11 @@ var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
9
9
  var _jest = require("jest");
10
10
  var cache;
11
11
  function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
12
- /**
13
- * Run all tests with jest.
14
- * Configure where tests are located by using 'testPath'.
15
- * @memberOf module:js-build-tools
16
- * @returns {Promise<*>}
12
+ /**
13
+ * Run all tests with jest.
14
+ * Configure where tests are located by using 'testPath'.
15
+ * @memberOf module:js-build-tools
16
+ * @returns {Promise<*>}
17
17
  */
18
18
  const testFull = () => {
19
19
  let testPath = gulpConfig.get('test.path');
package/dist/testQuick.js CHANGED
@@ -9,11 +9,11 @@ var gulpConfig = _interopRequireWildcard(require("../gulp.config.js"));
9
9
  var _jest = require("jest");
10
10
  var cache;
11
11
  function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
12
- /**
13
- * Run the Jest tests for files which have been modified (based on git status).
14
- * Configure where tests are located by using 'testPath'.
15
- * @memberOf module:js-build-tools
16
- * @returns {Promise<*>}
12
+ /**
13
+ * Run the Jest tests for files which have been modified (based on git status).
14
+ * Configure where tests are located by using 'testPath'.
15
+ * @memberOf module:js-build-tools
16
+ * @returns {Promise<*>}
17
17
  */
18
18
  const testQuick = () => {
19
19
  let testPath = gulpConfig.get('test.path');
package/dist/typeDocs.js CHANGED
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.typeDocs = void 0;
7
7
  var _typeDocsFor = require("./partials/typeDocsFor.js");
8
- /**
9
- * Generate the HTML documentation of a TypeScript project from its source, with the modules mirroring the source
10
- * folders. Turn it on with docs.enabled, see {@link module:partials.typeDocsFor}.
11
- * @memberOf module:js-build-tools
12
- * @returns {Function}
8
+ /**
9
+ * Generate the HTML documentation of a TypeScript project from its source, with the modules mirroring the source
10
+ * folders. Turn it on with docs.enabled, see {@link module:partials.typeDocsFor}.
11
+ * @memberOf module:js-build-tools
12
+ * @returns {Function}
13
13
  */
14
14
  const typeDocs = exports.typeDocs = (0, _typeDocsFor.typeDocsFor)();
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.typeScript = void 0;
7
7
  var _tsFor = require("./partials/tsFor.js");
8
- /**
9
- * Simplified typescript task using tsFor.
10
- * @memberOf module:js-build-tools
11
- * @returns {Function}
8
+ /**
9
+ * Simplified typescript task using tsFor.
10
+ * @memberOf module:js-build-tools
11
+ * @returns {Function}
12
12
  */
13
13
  const typeScript = exports.typeScript = (0, _tsFor.tsFor)();
@@ -11,18 +11,18 @@ var _os = _interopRequireDefault(require("os"));
11
11
  var _path = _interopRequireDefault(require("path"));
12
12
  var _esmNamedExportsToCjs = require("./esmNamedExportsToCjs.js");
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
- /**
15
- * Writes a rewritten (see {@link esmNamedExportsToCjs}) copy of each given `.mjs` file into a fresh, unique
16
- * directory under the OS temp directory, with a `.js` extension - jsdoc-to-markdown only recognizes `.js` as a
17
- * documentable file, regardless of whether its contents are actually CommonJS or ESM (it parses the real ESM
18
- * syntax of the rest of a file fine; the extension is the only thing it filters on). Writing outside the project
19
- * tree means there is nothing to gitignore and nothing left behind in the project - call the returned `cleanUp`
20
- * once done (for example, right after jsdoc-to-markdown has read the files) to remove the temp directory.
21
- * @memberOf module:utilities
22
- * @param {Array<string>} mjsFilePaths - Real `.mjs` files to convert. An empty array is a safe, cheap no-op.
23
- * @returns {{filePaths: Array<string>, cleanUp: function(): void}} The temp `.js` file paths to pass to
24
- * jsdoc-to-markdown instead of the real `.mjs` ones, and a function to remove the temp directory afterward.
25
- * @private
14
+ /**
15
+ * Writes a rewritten (see {@link esmNamedExportsToCjs}) copy of each given `.mjs` file into a fresh, unique
16
+ * directory under the OS temp directory, with a `.js` extension - jsdoc-to-markdown only recognizes `.js` as a
17
+ * documentable file, regardless of whether its contents are actually CommonJS or ESM (it parses the real ESM
18
+ * syntax of the rest of a file fine; the extension is the only thing it filters on). Writing outside the project
19
+ * tree means there is nothing to gitignore and nothing left behind in the project - call the returned `cleanUp`
20
+ * once done (for example, right after jsdoc-to-markdown has read the files) to remove the temp directory.
21
+ * @memberOf module:utilities
22
+ * @param {Array<string>} mjsFilePaths - Real `.mjs` files to convert. An empty array is a safe, cheap no-op.
23
+ * @returns {{filePaths: Array<string>, cleanUp: function(): void}} The temp `.js` file paths to pass to
24
+ * jsdoc-to-markdown instead of the real `.mjs` ones, and a function to remove the temp directory afterward.
25
+ * @private
26
26
  */
27
27
  const convertMjsFilesForDocs = (mjsFilePaths = []) => {
28
28
  if (mjsFilePaths.length === 0) {
@@ -1,55 +1,55 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.dotGet = void 0;
7
- var _isObject = require("./isObject.js");
8
- var _strAfter = require("./strAfter.js");
9
- var _strBefore = require("./strBefore.js");
10
- /**
11
- * Get a nested property value from an object.
12
- * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotGet.ts Sí, funciona}
13
- * @param {Object} [arrayObject={}] - The array or object to get the property from
14
- * @param {string} [dotNotation=''] - The path to the property
15
- * @param {string|null} [defaultValue=null] - The default value to return if the property is not found
16
- * @returns {*} The value of the property
17
- * @private
18
- */
19
- const dotGet = (arrayObject = {}, dotNotation = '', defaultValue = null) => {
20
- if (!dotNotation) {
21
- return arrayObject;
22
- }
23
- let key = (0, _strBefore.strBefore)(dotNotation, '.');
24
- const lastKey = !key;
25
- if (lastKey) {
26
- key = dotNotation;
27
- }
28
- if (key === '*') {
29
- const result = [];
30
- for (const wildKey in arrayObject) {
31
- const wildValue = arrayObject[wildKey];
32
- if (lastKey) {
33
- result[wildKey] = wildValue;
34
- continue;
35
- }
36
- if (!(0, _isObject.isObject)(wildValue)) {
37
- continue;
38
- }
39
- result[wildKey] = dotGet(wildValue, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
40
- }
41
- return result;
42
- }
43
- if (lastKey) {
44
- return arrayObject[dotNotation] ?? defaultValue;
45
- }
46
- if (typeof arrayObject[key] === 'undefined') {
47
- return defaultValue;
48
- }
49
- const next = arrayObject[key];
50
- if (!(0, _isObject.isObject)(next)) {
51
- return defaultValue;
52
- }
53
- return dotGet(next, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
54
- };
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.dotGet = void 0;
7
+ var _isObject = require("./isObject.js");
8
+ var _strAfter = require("./strAfter.js");
9
+ var _strBefore = require("./strBefore.js");
10
+ /**
11
+ * Get a nested property value from an object.
12
+ * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotGet.ts Sí, funciona}
13
+ * @param {Object} [arrayObject={}] - The array or object to get the property from
14
+ * @param {string} [dotNotation=''] - The path to the property
15
+ * @param {string|null} [defaultValue=null] - The default value to return if the property is not found
16
+ * @returns {*} The value of the property
17
+ * @private
18
+ */
19
+ const dotGet = (arrayObject = {}, dotNotation = '', defaultValue = null) => {
20
+ if (!dotNotation) {
21
+ return arrayObject;
22
+ }
23
+ let key = (0, _strBefore.strBefore)(dotNotation, '.');
24
+ const lastKey = !key;
25
+ if (lastKey) {
26
+ key = dotNotation;
27
+ }
28
+ if (key === '*') {
29
+ const result = [];
30
+ for (const wildKey in arrayObject) {
31
+ const wildValue = arrayObject[wildKey];
32
+ if (lastKey) {
33
+ result[wildKey] = wildValue;
34
+ continue;
35
+ }
36
+ if (!(0, _isObject.isObject)(wildValue)) {
37
+ continue;
38
+ }
39
+ result[wildKey] = dotGet(wildValue, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
40
+ }
41
+ return result;
42
+ }
43
+ if (lastKey) {
44
+ return arrayObject[dotNotation] ?? defaultValue;
45
+ }
46
+ if (typeof arrayObject[key] === 'undefined') {
47
+ return defaultValue;
48
+ }
49
+ const next = arrayObject[key];
50
+ if (!(0, _isObject.isObject)(next)) {
51
+ return defaultValue;
52
+ }
53
+ return dotGet(next, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
54
+ };
55
55
  exports.dotGet = dotGet;
@@ -1,80 +1,80 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.dotNotate = void 0;
7
- require("core-js/modules/esnext.iterator.constructor.js");
8
- require("core-js/modules/esnext.iterator.map.js");
9
- var _isObject = require("./isObject.js");
10
- /**
11
- * Convert an array of keys into a regex, return a function to test if incoming keys match.
12
- * @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
13
- * @returns {Function} The dot-notated array
14
- * @private
15
- */
16
- const handleRetainObjects = (retainObjects = []) => {
17
- if (!retainObjects.length) {
18
- /**
19
- * Bypass the test function if there are no retainObjects.
20
- * @returns {false}
21
- * @private
22
- */
23
- return (currentKey, value, results) => false;
24
- }
25
- retainObjects = retainObjects.map(key => key.replaceAll('.', '\\.'));
26
- const retainRegex = new RegExp(`(${retainObjects.join('|')})$`);
27
- /**
28
- * Test if a key should be retained as an object.
29
- * @param {string} currentKey - The key to test
30
- * @param {*} value - The value of the key
31
- * @param {Object} results - The result object to add to
32
- * @returns {boolean}
33
- * @private
34
- */
35
- return (currentKey, value, results) => {
36
- if (!currentKey.match(retainRegex)) {
37
- return false;
38
- }
39
- results[currentKey] = value;
40
- return true;
41
- };
42
- };
43
-
44
- /**
45
- * The underlying logic function for converting arrays to dot-notation.
46
- * @param {Object} arrayObject - The array or object to dot-notate
47
- * @param {Function} didRetain - The test function to see if a key should be retained
48
- * @param {string} [prepend=''] - The path for the property being processed
49
- * @param {Object<string, *>} [results={}] - The final notated object to return
50
- * @returns {Object<string, *>} The dot-notated object
51
- * @private
52
- */
53
- const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) => {
54
- for (const key in arrayObject) {
55
- const value = arrayObject[key];
56
- const currentKey = `${prepend}${key}`;
57
- if (didRetain(currentKey, value, results)) {
58
- continue;
59
- }
60
- // An empty object/array has no keys to flatten into - recursing into one would silently drop currentKey
61
- // from the result entirely, rather than keeping it as the empty value it actually is. Treat it as a leaf.
62
- if ((0, _isObject.isObject)(value) && Object.keys(value).length) {
63
- performDotNotate(value, didRetain, `${currentKey}.`, results);
64
- continue;
65
- }
66
- results[currentKey] = value;
67
- }
68
- return results;
69
- };
70
-
71
- /**
72
- * Convert an array or object to a single dimensional associative array with dot notation.
73
- * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotNotate.ts Sí, funciona}
74
- * @param {Object} arrayObject - The array or object to dot-notate
75
- * @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
76
- * @returns {Object<string, *>} The dot-notated object
77
- * @private
78
- */
79
- const dotNotate = (arrayObject, retainObjects = []) => performDotNotate(arrayObject, handleRetainObjects(retainObjects));
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.dotNotate = void 0;
7
+ require("core-js/modules/esnext.iterator.constructor.js");
8
+ require("core-js/modules/esnext.iterator.map.js");
9
+ var _isObject = require("./isObject.js");
10
+ /**
11
+ * Convert an array of keys into a regex, return a function to test if incoming keys match.
12
+ * @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
13
+ * @returns {Function} The dot-notated array
14
+ * @private
15
+ */
16
+ const handleRetainObjects = (retainObjects = []) => {
17
+ if (!retainObjects.length) {
18
+ /**
19
+ * Bypass the test function if there are no retainObjects.
20
+ * @returns {false}
21
+ * @private
22
+ */
23
+ return (currentKey, value, results) => false;
24
+ }
25
+ retainObjects = retainObjects.map(key => key.replaceAll('.', '\\.'));
26
+ const retainRegex = new RegExp(`(${retainObjects.join('|')})$`);
27
+ /**
28
+ * Test if a key should be retained as an object.
29
+ * @param {string} currentKey - The key to test
30
+ * @param {*} value - The value of the key
31
+ * @param {Object} results - The result object to add to
32
+ * @returns {boolean}
33
+ * @private
34
+ */
35
+ return (currentKey, value, results) => {
36
+ if (!currentKey.match(retainRegex)) {
37
+ return false;
38
+ }
39
+ results[currentKey] = value;
40
+ return true;
41
+ };
42
+ };
43
+
44
+ /**
45
+ * The underlying logic function for converting arrays to dot-notation.
46
+ * @param {Object} arrayObject - The array or object to dot-notate
47
+ * @param {Function} didRetain - The test function to see if a key should be retained
48
+ * @param {string} [prepend=''] - The path for the property being processed
49
+ * @param {Object<string, *>} [results={}] - The final notated object to return
50
+ * @returns {Object<string, *>} The dot-notated object
51
+ * @private
52
+ */
53
+ const performDotNotate = (arrayObject, didRetain, prepend = '', results = {}) => {
54
+ for (const key in arrayObject) {
55
+ const value = arrayObject[key];
56
+ const currentKey = `${prepend}${key}`;
57
+ if (didRetain(currentKey, value, results)) {
58
+ continue;
59
+ }
60
+ // An empty object/array has no keys to flatten into - recursing into one would silently drop currentKey
61
+ // from the result entirely, rather than keeping it as the empty value it actually is. Treat it as a leaf.
62
+ if ((0, _isObject.isObject)(value) && Object.keys(value).length) {
63
+ performDotNotate(value, didRetain, `${currentKey}.`, results);
64
+ continue;
65
+ }
66
+ results[currentKey] = value;
67
+ }
68
+ return results;
69
+ };
70
+
71
+ /**
72
+ * Convert an array or object to a single dimensional associative array with dot notation.
73
+ * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotNotate.ts Sí, funciona}
74
+ * @param {Object} arrayObject - The array or object to dot-notate
75
+ * @param {Array.<string>} [retainObjects=[]] - An array of keys to retain as objects
76
+ * @returns {Object<string, *>} The dot-notated object
77
+ * @private
78
+ */
79
+ const dotNotate = (arrayObject, retainObjects = []) => performDotNotate(arrayObject, handleRetainObjects(retainObjects));
80
80
  exports.dotNotate = dotNotate;
@@ -1,46 +1,46 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.dotSet = void 0;
7
- var _isObject = require("./isObject.js");
8
- var _strAfter = require("./strAfter.js");
9
- var _strBefore = require("./strBefore.js");
10
- /**
11
- * Set a nested property value an object.
12
- * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotSet.ts Sí, funciona}
13
- * @param {Object} arrayObject - The array or object to set the property on
14
- * @param {string} dotNotation - The path for the property
15
- * @param {*} value - The default value to return if the property is not found
16
- * @returns {Object} The modified object
17
- * @private
18
- */
19
- const dotSet = (arrayObject, dotNotation, value = null) => {
20
- let key = (0, _strBefore.strBefore)(dotNotation, '.');
21
- const lastKey = !key;
22
- if (lastKey) {
23
- key = dotNotation;
24
- }
25
- if (key === '*') {
26
- for (const wildKey in arrayObject) {
27
- if (lastKey) {
28
- arrayObject[wildKey] = value;
29
- continue;
30
- }
31
- if (!(0, _isObject.isObject)(arrayObject[wildKey])) {
32
- continue;
33
- }
34
- dotSet(arrayObject[wildKey], (0, _strAfter.strAfter)(dotNotation, '.'), value);
35
- }
36
- return arrayObject;
37
- }
38
- if (lastKey) {
39
- arrayObject[dotNotation] = value;
40
- return arrayObject;
41
- }
42
- const next = arrayObject[key] ?? [];
43
- arrayObject[key] = dotSet(next, (0, _strAfter.strAfter)(dotNotation, '.'), value);
44
- return arrayObject;
45
- };
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.dotSet = void 0;
7
+ var _isObject = require("./isObject.js");
8
+ var _strAfter = require("./strAfter.js");
9
+ var _strBefore = require("./strBefore.js");
10
+ /**
11
+ * Set a nested property value an object.
12
+ * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotSet.ts Sí, funciona}
13
+ * @param {Object} arrayObject - The array or object to set the property on
14
+ * @param {string} dotNotation - The path for the property
15
+ * @param {*} value - The default value to return if the property is not found
16
+ * @returns {Object} The modified object
17
+ * @private
18
+ */
19
+ const dotSet = (arrayObject, dotNotation, value = null) => {
20
+ let key = (0, _strBefore.strBefore)(dotNotation, '.');
21
+ const lastKey = !key;
22
+ if (lastKey) {
23
+ key = dotNotation;
24
+ }
25
+ if (key === '*') {
26
+ for (const wildKey in arrayObject) {
27
+ if (lastKey) {
28
+ arrayObject[wildKey] = value;
29
+ continue;
30
+ }
31
+ if (!(0, _isObject.isObject)(arrayObject[wildKey])) {
32
+ continue;
33
+ }
34
+ dotSet(arrayObject[wildKey], (0, _strAfter.strAfter)(dotNotation, '.'), value);
35
+ }
36
+ return arrayObject;
37
+ }
38
+ if (lastKey) {
39
+ arrayObject[dotNotation] = value;
40
+ return arrayObject;
41
+ }
42
+ const next = arrayObject[key] ?? [];
43
+ arrayObject[key] = dotSet(next, (0, _strAfter.strAfter)(dotNotation, '.'), value);
44
+ return arrayObject;
45
+ };
46
46
  exports.dotSet = dotSet;
@@ -4,21 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.esmNamedExportsToCjs = void 0;
7
- /**
8
- * Rewrites named `export const`/`export function`/`export class` declarations to plain declarations plus a
9
- * trailing `module.exports = { ... }` - the same shape jsdoc-to-markdown already documents cleanly (a plain
10
- * declaration with its own `@memberOf` tag, exported all at once at the bottom), rather than the "exports.name"
11
- * longname jsdoc-to-markdown's own ESM-compat layer produces for an inline `export const name = ...`.
12
- *
13
- * This is a narrow, text-level rewrite for documentation purposes only - it does not execute the module, so it
14
- * only has to look enough like the real thing for jsdoc-to-markdown's parser. It handles the common named-export
15
- * forms (`export const`, `export function`, `export class`) and leaves everything else (including `export
16
- * default`, re-exports, and `export { a, b }` lists) untouched in place - a file using one of those keeps its
17
- * own export line as-is, which jsdoc-to-markdown will document however it already does for ESM.
18
- * @memberOf module:utilities
19
- * @param {string} source - The raw ESM source text (never executed, just rewritten as text).
20
- * @returns {string} The rewritten text, safe to write out with a `.js` extension for jsdoc-to-markdown to read.
21
- * @private
7
+ /**
8
+ * Rewrites named `export const`/`export function`/`export class` declarations to plain declarations plus a
9
+ * trailing `module.exports = { ... }` - the same shape jsdoc-to-markdown already documents cleanly (a plain
10
+ * declaration with its own `@memberOf` tag, exported all at once at the bottom), rather than the "exports.name"
11
+ * longname jsdoc-to-markdown's own ESM-compat layer produces for an inline `export const name = ...`.
12
+ *
13
+ * This is a narrow, text-level rewrite for documentation purposes only - it does not execute the module, so it
14
+ * only has to look enough like the real thing for jsdoc-to-markdown's parser. It handles the common named-export
15
+ * forms (`export const`, `export function`, `export class`) and leaves everything else (including `export
16
+ * default`, re-exports, and `export { a, b }` lists) untouched in place - a file using one of those keeps its
17
+ * own export line as-is, which jsdoc-to-markdown will document however it already does for ESM.
18
+ * @memberOf module:utilities
19
+ * @param {string} source - The raw ESM source text (never executed, just rewritten as text).
20
+ * @returns {string} The rewritten text, safe to write out with a `.js` extension for jsdoc-to-markdown to read.
21
+ * @private
22
22
  */
23
23
  const esmNamedExportsToCjs = source => {
24
24
  const exportedNames = [];
@@ -10,15 +10,15 @@ require("core-js/modules/esnext.iterator.map.js");
10
10
  var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
11
11
  var cache;
12
12
  function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var r, c, a = Object.defineProperty, n = { __proto__: null, default: e }; if (Object(e) !== e) return n; if (cache || "function" != typeof WeakMap || (cache = new WeakMap()), cache) { if (cache.has(e)) return cache.get(e); cache.set(e, n); } for (c in e) "default" !== c && {}.hasOwnProperty.call(e, c) && ((r = a && Object.getOwnPropertyDescriptor(e, c)) && (r.get || r.set) ? a(n, c, r) : n[c] = e[c]); return n; }
13
- /**
14
- * Build the full list of bundles to produce for this project: the primary bundle (browser.name /
15
- * dist.main / browser.ignore / browser.exclude, exactly as before browser.bundles existed) plus
16
- * any additional bundles from browser.bundles - each falling back to the primary's main / ignore /
17
- * exclude whenever its own isn't given, so a render-only (or any other variant) bundle only has to
18
- * specify what's actually different about it.
19
- * @memberOf module:utilities
20
- * @returns {Array<{name: string, main: string, ignore: Array, exclude: Array}>}
21
- * @private
13
+ /**
14
+ * Build the full list of bundles to produce for this project: the primary bundle (browser.name /
15
+ * dist.main / browser.ignore / browser.exclude, exactly as before browser.bundles existed) plus
16
+ * any additional bundles from browser.bundles - each falling back to the primary's main / ignore /
17
+ * exclude whenever its own isn't given, so a render-only (or any other variant) bundle only has to
18
+ * specify what's actually different about it.
19
+ * @memberOf module:utilities
20
+ * @returns {Array<{name: string, main: string, ignore: Array, exclude: Array}>}
21
+ * @private
22
22
  */
23
23
  const getBundleConfigs = () => {
24
24
  const primary = {
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isObject = void 0;
7
- /**
8
- * Check if the provided thing is an object / array.
9
- * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/isObject.ts Sí, funciona}
10
- * @param {*} object
11
- * @returns {boolean}
12
- * @private
7
+ /**
8
+ * Check if the provided thing is an object / array.
9
+ * Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/isObject.ts Sí, funciona}
10
+ * @param {*} object
11
+ * @returns {boolean}
12
+ * @private
13
13
  */
14
14
  const isObject = object => typeof object === 'object' && object !== null;
15
15
  exports.isObject = isObject;
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.strAfter = void 0;
7
- /**
8
- * Retrieve the string part after the search match.
9
- * Original source from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/strings/strAfter.ts Sí, funciona}
10
- * @param {string} str
11
- * @param {string} search
12
- * @returns {string}
13
- * @private
7
+ /**
8
+ * Retrieve the string part after the search match.
9
+ * Original source from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/strings/strAfter.ts Sí, funciona}
10
+ * @param {string} str
11
+ * @param {string} search
12
+ * @returns {string}
13
+ * @private
14
14
  */
15
15
  const strAfter = (str, search) => {
16
16
  const index = str.indexOf(search);