js-build-tools 6.6.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.
- package/LICENSE +674 -674
- package/README.md +762 -701
- package/babel.config.js +28 -28
- package/dist/build.js +75 -75
- package/dist/bundle.js +19 -19
- package/dist/bundleMinify.js +7 -7
- package/dist/compileReadme.js +4 -4
- package/dist/copyFiles.js +17 -17
- package/dist/copyFonts.js +4 -4
- package/dist/default.js +5 -5
- package/dist/dist.js +4 -4
- package/dist/distMinify.js +4 -4
- package/dist/docs.js +7 -7
- package/dist/images.js +4 -4
- package/dist/jsdocDocs.js +6 -6
- package/dist/lint.js +16 -16
- package/dist/partials/addToReadme.js +9 -9
- package/dist/partials/beginWatcher.js +4 -4
- package/dist/partials/clean.js +5 -5
- package/dist/partials/copyFor.js +9 -9
- package/dist/partials/distFor.js +6 -6
- package/dist/partials/distForSrc.js +5 -5
- package/dist/partials/distSeries.js +7 -7
- package/dist/partials/imagesFor.js +93 -93
- package/dist/partials/jsdocDocsFor.js +46 -46
- package/dist/partials/lintSource.js +51 -51
- package/dist/partials/loadPeer.js +99 -99
- package/dist/partials/loadPlaywright.js +14 -14
- package/dist/partials/minifyFor.js +20 -20
- package/dist/partials/neostandardLint.js +175 -175
- package/dist/partials/readmeTemplate.js +4 -4
- package/dist/partials/removeDirectory.js +11 -11
- package/dist/partials/resolveDocsMethod.js +6 -6
- package/dist/partials/runOnChange.js +31 -31
- package/dist/partials/sassFor.js +6 -6
- package/dist/partials/serveStatic.js +9 -9
- package/dist/partials/tsFor.js +32 -32
- package/dist/partials/typeDocsFor.js +264 -264
- package/dist/partials.js +176 -176
- package/dist/sourceLint.js +18 -18
- package/dist/test-helpers/isolateGulpCache.js +24 -24
- package/dist/test-helpers/setUp.js +4 -4
- package/dist/testFull.js +5 -5
- package/dist/testQuick.js +5 -5
- package/dist/typeDocs.js +5 -5
- package/dist/typeScript.js +4 -4
- package/dist/utilities/convertMjsFilesForDocs.js +12 -12
- package/dist/utilities/dotGet.js +54 -54
- package/dist/utilities/dotNotate.js +79 -79
- package/dist/utilities/dotSet.js +45 -45
- package/dist/utilities/esmNamedExportsToCjs.js +15 -15
- package/dist/utilities/getBundleConfigs.js +9 -9
- package/dist/utilities/isObject.js +6 -6
- package/dist/utilities/strAfter.js +7 -7
- package/dist/utilities/strBefore.js +7 -7
- package/dist/watchFull.js +4 -4
- package/dist/watchTest.js +4 -4
- package/functions/build.mjs +72 -72
- package/functions/build.test.mjs +763 -759
- package/functions/bundle.mjs +44 -44
- package/functions/bundle.test.mjs +219 -219
- package/functions/bundleMinify.mjs +16 -16
- package/functions/bundleMinify.test.mjs +37 -37
- package/functions/compileReadme.mjs +9 -9
- package/functions/compileReadme.test.mjs +18 -18
- package/functions/copyFiles.mjs +32 -32
- package/functions/copyFiles.test.mjs +78 -78
- package/functions/copyFonts.mjs +9 -9
- package/functions/copyFonts.test.mjs +32 -32
- package/functions/default.mjs +12 -12
- package/functions/default.test.mjs +33 -33
- package/functions/dist.mjs +8 -8
- package/functions/dist.test.mjs +44 -44
- package/functions/distMinify.mjs +9 -9
- package/functions/distMinify.test.mjs +15 -15
- package/functions/docs.mjs +13 -13
- package/functions/docs.test.mjs +45 -45
- package/functions/gulpConfigEntries.test.mjs +23 -23
- package/functions/images.mjs +8 -8
- package/functions/images.test.mjs +142 -142
- package/functions/jsdocDocs.mjs +10 -10
- package/functions/jsdocEsmExports.test.mjs +24 -24
- package/functions/lint.mjs +9 -9
- package/functions/partials/addToReadme.mjs +25 -25
- package/functions/partials/addToReadme.test.mjs +34 -34
- package/functions/partials/beginWatcher.mjs +9 -9
- package/functions/partials/beginWatcher.test.mjs +19 -19
- package/functions/partials/clean.mjs +13 -13
- package/functions/partials/clean.test.mjs +22 -22
- package/functions/partials/copyFor.mjs +15 -15
- package/functions/partials/copyFor.test.mjs +53 -53
- package/functions/partials/distFor.mjs +22 -22
- package/functions/partials/distFor.test.mjs +195 -195
- package/functions/partials/distForSrc.mjs +11 -11
- package/functions/partials/distForSrc.test.mjs +18 -18
- package/functions/partials/distSeries.mjs +21 -21
- package/functions/partials/distSeries.test.mjs +34 -34
- package/functions/partials/imagesFor.mjs +83 -83
- package/functions/partials/imagesFor.test.mjs +287 -287
- package/functions/partials/jsdocDocsFor.mjs +163 -152
- package/functions/partials/jsdocDocsFor.test.mjs +182 -152
- package/functions/partials/lintSource.mjs +41 -41
- package/functions/partials/loadPeer.mjs +76 -76
- package/functions/partials/loadPeer.test.mjs +58 -58
- package/functions/partials/loadPlaywright.mjs +23 -23
- package/functions/partials/loadPlaywright.test.mjs +70 -70
- package/functions/partials/minifyFor.mjs +15 -15
- package/functions/partials/minifyFor.test.mjs +49 -49
- package/functions/partials/neostandardLint.mjs +142 -142
- package/functions/partials/neostandardLint.test.mjs +131 -131
- package/functions/partials/readmeTemplate.mjs +12 -12
- package/functions/partials/readmeTemplate.test.mjs +34 -34
- package/functions/partials/removeDirectory.mjs +34 -34
- package/functions/partials/removeDirectory.test.mjs +72 -72
- package/functions/partials/resolveDocsMethod.mjs +10 -10
- package/functions/partials/resolveDocsMethod.test.mjs +33 -33
- package/functions/partials/runOnChange.mjs +54 -54
- package/functions/partials/runOnChange.test.mjs +95 -95
- package/functions/partials/sassFor.mjs +25 -25
- package/functions/partials/sassFor.test.mjs +81 -81
- package/functions/partials/serveStatic.mjs +47 -47
- package/functions/partials/serveStatic.test.mjs +71 -71
- package/functions/partials/tsFor.mjs +92 -92
- package/functions/partials/tsFor.test.mjs +88 -88
- package/functions/partials/typeDocsFor.mjs +231 -231
- package/functions/partials/typeDocsFor.test.mjs +263 -263
- package/functions/partials.mjs +31 -31
- package/functions/partials.test.mjs +7 -7
- package/functions/sass.mjs +4 -4
- package/functions/sass.test.mjs +31 -31
- package/functions/sourceLint.mjs +13 -13
- package/functions/sourceLint.test.mjs +166 -166
- package/functions/test-helpers/isolateGulpCache.mjs +16 -16
- package/functions/test-helpers/neostandardLintWithRealNeostandard.mjs +40 -40
- package/functions/test-helpers/setUp.mjs +100 -100
- package/functions/test-helpers/setUp.test.mjs +19 -19
- package/functions/testFull.mjs +17 -17
- package/functions/testFull.test.mjs +17 -17
- package/functions/testHelpers.mjs +10 -10
- package/functions/testHelpers.test.mjs +7 -7
- package/functions/testQuick.mjs +17 -17
- package/functions/testQuick.test.mjs +17 -17
- package/functions/typeDocs.mjs +9 -9
- package/functions/typeDocs.test.mjs +11 -11
- package/functions/typeScript.mjs +8 -8
- package/functions/typeScript.test.mjs +11 -11
- package/functions/utilities/convertMjsFilesForDocs.mjs +34 -34
- package/functions/utilities/convertMjsFilesForDocs.test.mjs +58 -58
- package/functions/utilities/dotGet.mjs +49 -49
- package/functions/utilities/dotNotate.mjs +73 -73
- package/functions/utilities/dotNotate.test.mjs +41 -41
- package/functions/utilities/dotSet.mjs +40 -40
- package/functions/utilities/esmNamedExportsToCjs.mjs +30 -30
- package/functions/utilities/esmNamedExportsToCjs.test.mjs +47 -47
- package/functions/utilities/getBundleConfigs.mjs +30 -30
- package/functions/utilities/isObject.mjs +8 -8
- package/functions/utilities/strAfter.mjs +12 -12
- package/functions/utilities/strBefore.mjs +12 -12
- package/functions/watchFull.mjs +9 -9
- package/functions/watchFull.test.mjs +41 -41
- package/functions/watchTest.mjs +10 -10
- package/functions/watchTest.test.mjs +49 -49
- package/gulp.config.js +4 -4
- package/gulp.config.mjs +344 -340
- package/gulpfile.base.js +51 -51
- package/gulpfile.base.mjs +29 -29
- package/jsdoc.base.js +16 -16
- package/jsdoc.esmExports.js +17 -17
- package/package.json +146 -145
package/dist/utilities/dotGet.js
CHANGED
|
@@ -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;
|
package/dist/utilities/dotSet.js
CHANGED
|
@@ -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);
|
|
@@ -4,13 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.strBefore = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Retrieve the string part before the search match.
|
|
9
|
-
* Original source from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/strings/strBefore.ts Sí, funciona}
|
|
10
|
-
* @param {string} str
|
|
11
|
-
* @param {string} search
|
|
12
|
-
* @returns {string}
|
|
13
|
-
* @private
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve the string part before the search match.
|
|
9
|
+
* Original source from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/strings/strBefore.ts Sí, funciona}
|
|
10
|
+
* @param {string} str
|
|
11
|
+
* @param {string} search
|
|
12
|
+
* @returns {string}
|
|
13
|
+
* @private
|
|
14
14
|
*/
|
|
15
15
|
const strBefore = (str, search) => {
|
|
16
16
|
const index = str.indexOf(search);
|
package/dist/watchFull.js
CHANGED
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.watchFull = void 0;
|
|
7
7
|
var _partials = require("./partials.js");
|
|
8
|
-
/**
|
|
9
|
-
* Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
10
|
-
* @memberOf module:js-build-tools
|
|
11
|
-
* @returns {FSWatcher}
|
|
8
|
+
/**
|
|
9
|
+
* Watch for changes and run the distribution for the changed files, then bundle and test the changed files.
|
|
10
|
+
* @memberOf module:js-build-tools
|
|
11
|
+
* @returns {FSWatcher}
|
|
12
12
|
*/
|
|
13
13
|
const watchFull = () => (0, _partials.beginWatcher)().on('change', _partials.runOnChange);
|
|
14
14
|
exports.watchFull = watchFull;
|
package/dist/watchTest.js
CHANGED
|
@@ -10,10 +10,10 @@ var _gulp = require("gulp");
|
|
|
10
10
|
var _testQuick = require("./testQuick.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
|
-
* Watch for changes and run the tests.
|
|
15
|
-
* @memberOf module:js-build-tools
|
|
16
|
-
* @returns {*}
|
|
13
|
+
/**
|
|
14
|
+
* Watch for changes and run the tests.
|
|
15
|
+
* @memberOf module:js-build-tools
|
|
16
|
+
* @returns {*}
|
|
17
17
|
*/
|
|
18
18
|
const watchTest = () => (0, _gulp.watch)(gulpConfig.get('test.watch'), {
|
|
19
19
|
ignoreInitial: false
|