js-build-tools 3.0.4 → 4.0.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/README.md +431 -691
- package/babel.config.js +1 -1
- package/dist/build.js +58 -59
- package/dist/build.min.js +1 -1
- package/dist/bundle.js +17 -12
- package/dist/bundle.min.js +1 -1
- package/dist/bundleLint.js +21 -17
- package/dist/bundleLint.min.js +1 -1
- package/dist/bundleMinify.js +14 -8
- package/dist/bundleMinify.min.js +1 -1
- package/dist/compileReadme.js +10 -13
- package/dist/compileReadme.min.js +1 -1
- package/dist/copyFonts.js +14 -8
- package/dist/copyFonts.min.js +1 -1
- package/dist/default.js +19 -15
- package/dist/default.min.js +1 -1
- package/dist/dist.js +10 -7
- package/dist/dist.min.js +1 -1
- package/dist/distLint.js +21 -17
- package/dist/distLint.min.js +1 -1
- package/dist/distMinify.js +14 -8
- package/dist/distMinify.min.js +1 -1
- package/dist/images.js +10 -7
- package/dist/images.min.js +1 -1
- package/dist/partials/addToReadme.js +19 -14
- package/dist/partials/beginWatcher.js +14 -10
- package/dist/partials/clean.js +17 -11
- package/dist/partials/copyFor.js +10 -10
- package/dist/partials/distFor.js +27 -17
- package/dist/partials/distForSrc.js +16 -10
- package/dist/partials/distSeries.js +24 -20
- package/dist/partials/imagesFor.js +27 -28
- package/dist/partials/minifyFor.js +17 -16
- package/dist/partials/readmeTemplate.js +16 -12
- package/dist/partials/removeDirectory.js +12 -12
- package/dist/partials/runOnChange.js +30 -28
- package/dist/partials/sassFor.js +28 -21
- package/dist/partials/tsFor.js +24 -21
- package/dist/partials.js +103 -41
- package/dist/partials.min.js +1 -1
- package/dist/sass.js +10 -7
- package/dist/sass.min.js +1 -1
- package/dist/test-helpers/setUp.js +68 -65
- package/dist/testFull.js +22 -17
- package/dist/testFull.min.js +1 -1
- package/dist/testHelpers.js +11 -15
- package/dist/testHelpers.min.js +1 -1
- package/dist/testQuick.js +24 -19
- package/dist/testQuick.min.js +1 -1
- package/dist/typeScript.js +9 -7
- package/dist/typeScript.min.js +1 -1
- package/dist/utilities/dotGet.js +45 -43
- package/dist/utilities/dotNotate.js +53 -51
- package/dist/utilities/dotSet.js +39 -37
- package/dist/utilities/isObject.js +9 -5
- package/dist/utilities/strAfter.js +18 -14
- package/dist/utilities/strBefore.js +18 -14
- package/dist/watchFull.js +10 -10
- package/dist/watchFull.min.js +1 -1
- package/dist/watchTest.js +17 -13
- package/dist/watchTest.min.js +1 -1
- package/functions/{build.js → build.mjs} +14 -16
- package/functions/{build.test.js → build.test.mjs} +9 -8
- package/functions/{bundle.js → bundle.mjs} +5 -7
- package/functions/{bundle.test.js → bundle.test.mjs} +5 -4
- package/functions/{bundleLint.js → bundleLint.mjs} +4 -6
- package/functions/{bundleLint.test.js → bundleLint.test.mjs} +5 -4
- package/functions/bundleMinify.mjs +9 -0
- package/functions/bundleMinify.test.mjs +15 -0
- package/functions/compileReadme.mjs +9 -0
- package/functions/{compileReadme.test.js → compileReadme.test.mjs} +4 -4
- package/functions/copyFonts.mjs +9 -0
- package/functions/{copyFonts.test.js → copyFonts.test.mjs} +4 -3
- package/functions/default.mjs +12 -0
- package/functions/{default.test.js → default.test.mjs} +8 -7
- package/functions/{dist.js → dist.mjs} +2 -4
- package/functions/{dist.test.js → dist.test.mjs} +4 -3
- package/functions/{distLint.js → distLint.mjs} +4 -6
- package/functions/{distLint.test.js → distLint.test.mjs} +5 -4
- package/functions/distMinify.mjs +9 -0
- package/functions/distMinify.test.mjs +15 -0
- package/functions/{images.js → images.mjs} +2 -4
- package/functions/{images.test.js → images.test.mjs} +4 -3
- package/functions/partials/{addToReadme.js → addToReadme.mjs} +5 -7
- package/functions/partials/{addToReadme.test.js → addToReadme.test.mjs} +4 -3
- package/functions/partials/beginWatcher.mjs +9 -0
- package/functions/partials/{beginWatcher.test.js → beginWatcher.test.mjs} +4 -3
- package/functions/partials/clean.mjs +13 -0
- package/functions/partials/{clean.test.js → clean.test.mjs} +4 -3
- package/functions/partials/{copyFor.js → copyFor.mjs} +2 -4
- package/functions/partials/{copyFor.test.js → copyFor.test.mjs} +4 -3
- package/functions/partials/distFor.mjs +22 -0
- package/functions/partials/{distFor.test.js → distFor.test.mjs} +49 -8
- package/functions/partials/{distForSrc.js → distForSrc.mjs} +2 -4
- package/functions/partials/{distForSrc.test.js → distForSrc.test.mjs} +3 -2
- package/functions/partials/{distSeries.js → distSeries.mjs} +6 -8
- package/functions/partials/{distSeries.test.js → distSeries.test.mjs} +7 -6
- package/functions/partials/{imagesFor.js → imagesFor.mjs} +5 -13
- package/functions/partials/{imagesFor.test.js → imagesFor.test.mjs} +4 -3
- package/functions/partials/minifyFor.mjs +15 -0
- package/functions/partials/{minifyFor.test.js → minifyFor.test.mjs} +5 -4
- package/functions/partials/readmeTemplate.mjs +12 -0
- package/functions/partials/{readmeTemplate.test.js → readmeTemplate.test.mjs} +4 -3
- package/functions/partials/{removeDirectory.js → removeDirectory.mjs} +2 -4
- package/functions/partials/{removeDirectory.test.js → removeDirectory.test.mjs} +28 -28
- package/functions/partials/{runOnChange.js → runOnChange.mjs} +6 -8
- package/functions/partials/{runOnChange.test.js → runOnChange.test.mjs} +12 -11
- package/functions/partials/sassFor.mjs +22 -0
- package/functions/partials/{sassFor.test.js → sassFor.test.mjs} +5 -4
- package/functions/partials/{tsFor.js → tsFor.mjs} +4 -6
- package/functions/partials/{tsFor.test.js → tsFor.test.mjs} +5 -4
- package/functions/partials.mjs +23 -0
- package/functions/{partials.test.js → partials.test.mjs} +1 -1
- package/functions/sass.mjs +4 -0
- package/functions/{sass.test.js → sass.test.mjs} +4 -3
- package/functions/test-helpers/{setUp.js → setUp.mjs} +25 -27
- package/functions/test-helpers/setUp.test.mjs +19 -0
- package/functions/{testFull.js → testFull.mjs} +4 -6
- package/functions/testFull.test.mjs +17 -0
- package/functions/{testHelpers.js → testHelpers.mjs} +1 -6
- package/functions/testHelpers.test.mjs +7 -0
- package/functions/{testQuick.js → testQuick.mjs} +4 -6
- package/functions/testQuick.test.mjs +17 -0
- package/functions/{typeScript.js → typeScript.mjs} +2 -4
- package/functions/typeScript.test.mjs +11 -0
- package/functions/utilities/{dotGet.js → dotGet.mjs} +4 -6
- package/functions/utilities/{dotNotate.js → dotNotate.mjs} +2 -4
- package/functions/utilities/{dotSet.js → dotSet.mjs} +4 -6
- package/functions/utilities/{isObject.js → isObject.mjs} +1 -3
- package/functions/utilities/{strAfter.js → strAfter.mjs} +11 -13
- package/functions/utilities/{strBefore.js → strBefore.mjs} +11 -13
- package/functions/{watchFull.js → watchFull.mjs} +2 -4
- package/functions/{watchFull.test.js → watchFull.test.mjs} +8 -7
- package/functions/watchTest.mjs +10 -0
- package/functions/{watchTest.test.js → watchTest.test.mjs} +7 -6
- package/gulp.config.js +20 -19
- package/gulp.config.mjs +252 -0
- package/gulpfile.base.js +20 -20
- package/gulpfile.base.mjs +27 -0
- package/package.json +19 -13
- package/functions/bundleMinify.js +0 -11
- package/functions/bundleMinify.test.js +0 -14
- package/functions/compileReadme.js +0 -11
- package/functions/copyFonts.js +0 -11
- package/functions/default.js +0 -14
- package/functions/distMinify.js +0 -11
- package/functions/distMinify.test.js +0 -14
- package/functions/partials/beginWatcher.js +0 -11
- package/functions/partials/clean.js +0 -15
- package/functions/partials/distFor.js +0 -17
- package/functions/partials/minifyFor.js +0 -15
- package/functions/partials/readmeTemplate.js +0 -14
- package/functions/partials/sassFor.js +0 -21
- package/functions/partials.js +0 -40
- package/functions/sass.js +0 -6
- package/functions/test-helpers/setUp.test.js +0 -18
- package/functions/testFull.test.js +0 -16
- package/functions/testHelpers.test.js +0 -7
- package/functions/testQuick.test.js +0 -16
- package/functions/typeScript.test.js +0 -10
- package/functions/watchTest.js +0 -12
- package/vendor/array-union/index.js +0 -31
- package/vendor/easy-transform-stream/index.js +0 -54
- package/vendor/globby/gitignore.js +0 -96
- package/vendor/globby/index.js +0 -191
- package/vendor/globby/node_modules/slash/index.js +0 -16
- package/vendor/globby/stream-utils.js +0 -58
- package/vendor/globby/to-path.js +0 -20
- package/vendor/gulp-imagemin/index.js +0 -124
- package/vendor/gulp-imagemin/node_modules/chalk/source/index.js +0 -265
- package/vendor/gulp-imagemin/node_modules/chalk/source/utilities.js +0 -36
- package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -217
- package/vendor/gulp-imagemin/node_modules/chalk/source/vendor/supports-color/index.js +0 -154
- package/vendor/gulp-plugin-extras/index.js +0 -42
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/index.js +0 -265
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/utilities.js +0 -36
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -217
- package/vendor/gulp-plugin-extras/node_modules/chalk/source/vendor/supports-color/index.js +0 -154
- package/vendor/gulp-plugin-extras/plugin-error.js +0 -145
- package/vendor/ignore/index.js +0 -468
- package/vendor/imagemin/index.js +0 -90
- package/vendor/imagemin-gifsicle/index.js +0 -33
- package/vendor/imagemin-mozjpeg/index.js +0 -100
- package/vendor/imagemin-mozjpeg/node_modules/execa/index.js +0 -260
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/command.js +0 -47
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/error.js +0 -102
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/kill.js +0 -123
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/promise.js +0 -47
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stdio.js +0 -50
- package/vendor/imagemin-mozjpeg/node_modules/execa/lib/stream.js +0 -124
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/core.js +0 -238
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/main.js +0 -89
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/realtime.js +0 -24
- package/vendor/imagemin-mozjpeg/node_modules/human-signals/build/src/signals.js +0 -44
- package/vendor/imagemin-mozjpeg/node_modules/is-stream/index.js +0 -25
- package/vendor/imagemin-mozjpeg/node_modules/mimic-fn/index.js +0 -70
- package/vendor/imagemin-mozjpeg/node_modules/npm-run-path/index.js +0 -52
- package/vendor/imagemin-mozjpeg/node_modules/onetime/index.js +0 -43
- package/vendor/imagemin-mozjpeg/node_modules/path-key/index.js +0 -20
- package/vendor/imagemin-mozjpeg/node_modules/strip-final-newline/index.js +0 -17
- package/vendor/imagemin-optipng/index.js +0 -44
- package/vendor/imagemin-svgo/index.js +0 -27
- package/vendor/is-jpg/index.js +0 -12
- package/vendor/junk/index.js +0 -49
- package/vendor/mozjpeg/index.js +0 -9
- package/vendor/mozjpeg/lib/index.js +0 -18
- package/vendor/mozjpeg/package.json +0 -49
- package/vendor/mozjpeg/vendor/cjpeg +0 -0
- package/vendor/mozjpeg/vendor/source/mozjpeg.tar.gz +0 -0
- package/vendor/p-pipe/index.js +0 -22
- package/vendor/plur/index.js +0 -32
- package/vendor/pretty-bytes/index.js +0 -71
- package/vendor/slash/index.js +0 -12
package/dist/partials.js
CHANGED
|
@@ -1,41 +1,103 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
Object.defineProperty(exports, 'addToReadme', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _addToReadme.addToReadme
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
Object.defineProperty(exports, 'beginWatcher', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _beginWatcher.beginWatcher
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
Object.defineProperty(exports, 'clean', {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _clean.clean
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
Object.defineProperty(exports, 'copyFor', {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _copyFor.copyFor
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
Object.defineProperty(exports, 'distFor', {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _distFor.distFor
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
Object.defineProperty(exports, 'distForSrc', {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _distForSrc.distForSrc
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
Object.defineProperty(exports, 'distSeries', {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _distSeries.distSeries
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
Object.defineProperty(exports, 'imagesFor', {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _imagesFor.imagesFor
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
Object.defineProperty(exports, 'minifyFor', {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _minifyFor.minifyFor
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
Object.defineProperty(exports, 'readmeTemplate', {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _readmeTemplate.readmeTemplate
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
Object.defineProperty(exports, 'removeDirectory', {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _removeDirectory.removeDirectory
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
Object.defineProperty(exports, 'runOnChange', {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _runOnChange.runOnChange
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
Object.defineProperty(exports, 'sassFor', {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _sassFor.sassFor
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
Object.defineProperty(exports, 'tsFor', {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _tsFor.tsFor
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
var _addToReadme = require('./partials/addToReadme.js')
|
|
91
|
+
var _beginWatcher = require('./partials/beginWatcher.js')
|
|
92
|
+
var _clean = require('./partials/clean.js')
|
|
93
|
+
var _copyFor = require('./partials/copyFor.js')
|
|
94
|
+
var _distFor = require('./partials/distFor.js')
|
|
95
|
+
var _distForSrc = require('./partials/distForSrc.js')
|
|
96
|
+
var _distSeries = require('./partials/distSeries.js')
|
|
97
|
+
var _imagesFor = require('./partials/imagesFor.js')
|
|
98
|
+
var _minifyFor = require('./partials/minifyFor.js')
|
|
99
|
+
var _readmeTemplate = require('./partials/readmeTemplate.js')
|
|
100
|
+
var _removeDirectory = require('./partials/removeDirectory.js')
|
|
101
|
+
var _runOnChange = require('./partials/runOnChange.js')
|
|
102
|
+
var _sassFor = require('./partials/sassFor.js')
|
|
103
|
+
var _tsFor = require('./partials/tsFor.js')
|
package/dist/partials.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"addToReadme",{enumerable:!0,get:function(){return _addToReadme.addToReadme}}),Object.defineProperty(exports,"beginWatcher",{enumerable:!0,get:function(){return _beginWatcher.beginWatcher}}),Object.defineProperty(exports,"clean",{enumerable:!0,get:function(){return _clean.clean}}),Object.defineProperty(exports,"copyFor",{enumerable:!0,get:function(){return _copyFor.copyFor}}),Object.defineProperty(exports,"distFor",{enumerable:!0,get:function(){return _distFor.distFor}}),Object.defineProperty(exports,"distForSrc",{enumerable:!0,get:function(){return _distForSrc.distForSrc}}),Object.defineProperty(exports,"distSeries",{enumerable:!0,get:function(){return _distSeries.distSeries}}),Object.defineProperty(exports,"imagesFor",{enumerable:!0,get:function(){return _imagesFor.imagesFor}}),Object.defineProperty(exports,"minifyFor",{enumerable:!0,get:function(){return _minifyFor.minifyFor}}),Object.defineProperty(exports,"readmeTemplate",{enumerable:!0,get:function(){return _readmeTemplate.readmeTemplate}}),Object.defineProperty(exports,"removeDirectory",{enumerable:!0,get:function(){return _removeDirectory.removeDirectory}}),Object.defineProperty(exports,"runOnChange",{enumerable:!0,get:function(){return _runOnChange.runOnChange}}),Object.defineProperty(exports,"sassFor",{enumerable:!0,get:function(){return _sassFor.sassFor}}),Object.defineProperty(exports,"tsFor",{enumerable:!0,get:function(){return _tsFor.tsFor}});var _addToReadme=require("./partials/addToReadme.js"),_beginWatcher=require("./partials/beginWatcher.js"),_clean=require("./partials/clean.js"),_copyFor=require("./partials/copyFor.js"),_distFor=require("./partials/distFor.js"),_distForSrc=require("./partials/distForSrc.js"),_distSeries=require("./partials/distSeries.js"),_imagesFor=require("./partials/imagesFor.js"),_minifyFor=require("./partials/minifyFor.js"),_readmeTemplate=require("./partials/readmeTemplate.js"),_removeDirectory=require("./partials/removeDirectory.js"),_runOnChange=require("./partials/runOnChange.js"),_sassFor=require("./partials/sassFor.js"),_tsFor=require("./partials/tsFor.js");
|
package/dist/sass.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.sass = void 0
|
|
7
|
+
var _sassFor = require('./partials/sassFor.js')
|
|
8
|
+
// Compile sass into CSS & auto-inject into browsers
|
|
9
|
+
const sass = () => (0, _sassFor.sassFor)()
|
|
10
|
+
exports.sass = sass
|
package/dist/sass.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sass=void 0;var _sassFor=require("./partials/sassFor.js");const sass=()=>(0,_sassFor.sassFor)();exports.sass=sass;
|
|
@@ -1,69 +1,72 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "afterEach", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return setUp.afterEach;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "beforeEach", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return setUp.beforeEach;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "createTempDir", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return setUp.createTempDir;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
exports.setUp = exports.setDefaults = exports.gulpConfig = void 0;
|
|
26
|
+
var gulpConfig = _interopRequireWildcard(require("../../gulp.config.js"));
|
|
27
|
+
exports.gulpConfig = gulpConfig;
|
|
28
|
+
var setUp = _interopRequireWildcard(require("test-filesystem"));
|
|
29
|
+
exports.setUp = setUp;
|
|
30
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
|
+
// Import the configurations and override some of them to direct to the temp directory.
|
|
33
|
+
|
|
34
|
+
let tempDir = 'test-temp/';
|
|
35
|
+
let srcPath = `${tempDir}src`;
|
|
36
|
+
|
|
11
37
|
/**
|
|
12
38
|
* Update the gulp configurations with the test data. Set the test directory where temp files will be created for testing.
|
|
13
39
|
* @memberOf module:testHelpers
|
|
14
40
|
* @param {string} testDir
|
|
15
|
-
*/
|
|
16
|
-
const setDefaults = function () {
|
|
17
|
-
let testDir = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'test-temp';
|
|
18
|
-
tempDir =
|
|
19
|
-
srcPath =
|
|
20
|
-
setUp.setDefaults(tempDir);
|
|
21
|
-
const distPath =
|
|
22
|
-
const browserPath =
|
|
23
|
-
const sassPath =
|
|
24
|
-
gulpConfig.set('browser.from',
|
|
25
|
-
gulpConfig.set('browser.to', browserPath);
|
|
26
|
-
gulpConfig.set('cleanPaths', [distPath, browserPath]);
|
|
27
|
-
gulpConfig.set('dist.from',
|
|
28
|
-
gulpConfig.set('dist.main',
|
|
29
|
-
gulpConfig.set('dist.to', distPath);
|
|
30
|
-
gulpConfig.set('fonts.from',
|
|
31
|
-
gulpConfig.set('fonts.to',
|
|
32
|
-
gulpConfig.set('images.from',
|
|
33
|
-
gulpConfig.set('images.to',
|
|
34
|
-
gulpConfig.set('readme.template',
|
|
35
|
-
gulpConfig.set('readme.to', tempDir);
|
|
36
|
-
gulpConfig.set('readme.from',
|
|
37
|
-
gulpConfig.set('rootPath', tempDir);
|
|
38
|
-
gulpConfig.set('sass.from',
|
|
39
|
-
gulpConfig.set('sass.path', sassPath);
|
|
40
|
-
gulpConfig.set('sass.to',
|
|
41
|
-
gulpConfig.set('srcPath', srcPath);
|
|
42
|
-
gulpConfig.set('typescript.from',
|
|
43
|
-
gulpConfig.set('typescript.to', distPath);
|
|
44
|
-
gulpConfig.set('test.watch',
|
|
45
|
-
};
|
|
46
|
-
exports.setDefaults = setDefaults;
|
|
47
|
-
exports.gulpConfig = gulpConfig;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Ensure that the del has completed, recursively attempt to delete and recreate
|
|
51
|
-
* @memberOf module:testHelpers
|
|
52
|
-
* @param {boolean} [exists=true]
|
|
53
|
-
* @returns {Promise<*|void>}
|
|
54
|
-
*/
|
|
55
|
-
exports.createTempDir = setUp.createTempDir;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* In the Jest.beforeEach function call this one to set up the temp directory.
|
|
59
|
-
* @memberOf module:testHelpers
|
|
60
|
-
* @returns {Promise<*|void>}
|
|
61
|
-
*/
|
|
62
|
-
exports.beforeEach = setUp.beforeEach;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* In the Jest.afterEach function call this one to clean up and remove the temp directory.
|
|
66
|
-
* @memberOf module:testHelpers
|
|
67
|
-
* @returns {Promise<*>}
|
|
68
|
-
*/
|
|
69
|
-
exports.afterEach = setUp.afterEach;
|
|
41
|
+
*/
|
|
42
|
+
const setDefaults = function () {
|
|
43
|
+
let testDir = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'test-temp';
|
|
44
|
+
tempDir = `${testDir}/`;
|
|
45
|
+
srcPath = `${tempDir}src`;
|
|
46
|
+
setUp.setDefaults(tempDir);
|
|
47
|
+
const distPath = `${tempDir}dist`;
|
|
48
|
+
const browserPath = `${tempDir}browser`;
|
|
49
|
+
const sassPath = `${tempDir}sass`;
|
|
50
|
+
gulpConfig.set('browser.from', `${distPath}/**/*.js`);
|
|
51
|
+
gulpConfig.set('browser.to', browserPath);
|
|
52
|
+
gulpConfig.set('cleanPaths', [distPath, browserPath]);
|
|
53
|
+
gulpConfig.set('dist.from', `${srcPath}/**/!(*.test).js`);
|
|
54
|
+
gulpConfig.set('dist.main', `${distPath}/main`);
|
|
55
|
+
gulpConfig.set('dist.to', distPath);
|
|
56
|
+
gulpConfig.set('fonts.from', `${srcPath}/fonts/**/*`);
|
|
57
|
+
gulpConfig.set('fonts.to', `${browserPath}/fonts`);
|
|
58
|
+
gulpConfig.set('images.from', `${srcPath}/img/**/*.+(png|jpg|jpeg|gif|svg)`);
|
|
59
|
+
gulpConfig.set('images.to', `${browserPath}/img`);
|
|
60
|
+
gulpConfig.set('readme.template', `${tempDir}MAIN.md`);
|
|
61
|
+
gulpConfig.set('readme.to', tempDir);
|
|
62
|
+
gulpConfig.set('readme.from', `${srcPath}/**/!(*.test).js`);
|
|
63
|
+
gulpConfig.set('rootPath', tempDir);
|
|
64
|
+
gulpConfig.set('sass.from', `${sassPath}/**/*.+(scss|sass)`);
|
|
65
|
+
gulpConfig.set('sass.path', sassPath);
|
|
66
|
+
gulpConfig.set('sass.to', `${browserPath}/css`);
|
|
67
|
+
gulpConfig.set('srcPath', srcPath);
|
|
68
|
+
gulpConfig.set('typescript.from', `${srcPath}/**/*.ts`);
|
|
69
|
+
gulpConfig.set('typescript.to', distPath);
|
|
70
|
+
gulpConfig.set('test.watch', `${srcPath}/**/*.js`);
|
|
71
|
+
};
|
|
72
|
+
exports.setDefaults = setDefaults;
|
package/dist/testFull.js
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
+
Object.defineProperty(exports, '__esModule', {
|
|
5
|
+
value: true
|
|
6
|
+
})
|
|
7
|
+
exports.testFull = void 0
|
|
8
|
+
var gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
9
|
+
var _jest = _interopRequireDefault(require('jest'))
|
|
10
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
11
|
+
function _getRequireWildcardCache (e) { if (typeof WeakMap !== 'function') return null; var r = new WeakMap(); var t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r })(e) }
|
|
12
|
+
function _interopRequireWildcard (e, r) { if (!r && e && e.__esModule) return e; if (e === null || typeof e !== 'object' && typeof e !== 'function') return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }; var a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (u !== 'default' && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } return n.default = e, t && t.set(e, n), n }
|
|
8
13
|
/**
|
|
9
14
|
* Run all tests with jest.
|
|
10
15
|
* Configure where tests are located by using 'testPath'.
|
|
11
16
|
* @memberOf module:js-build-tools
|
|
12
17
|
* @returns {Promise<*>}
|
|
13
|
-
*/
|
|
14
|
-
const testFull = () => {
|
|
15
|
-
let testPath = gulpConfig.get('test.path')
|
|
16
|
-
if (!Array.isArray(testPath)) {
|
|
17
|
-
// The testPath must be an array of strings
|
|
18
|
-
testPath = [testPath]
|
|
19
|
-
}
|
|
20
|
-
return runCLI(gulpConfig.get('test.options'), testPath)
|
|
21
|
-
}
|
|
22
|
-
|
|
18
|
+
*/
|
|
19
|
+
const testFull = () => {
|
|
20
|
+
let testPath = gulpConfig.get('test.path')
|
|
21
|
+
if (!Array.isArray(testPath)) {
|
|
22
|
+
// The testPath must be an array of strings
|
|
23
|
+
testPath = [testPath]
|
|
24
|
+
}
|
|
25
|
+
return _jest.default.runCLI(gulpConfig.get('test.options'), testPath)
|
|
26
|
+
}
|
|
27
|
+
exports.testFull = testFull
|
package/dist/testFull.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.testFull=void 0;var gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_jest=_interopRequireDefault(require("jest"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(e){return e?r:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=_getRequireWildcardCache(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var l=n?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(u,i,l):u[i]=e[i]}return u.default=e,r&&r.set(e,u),u}const testFull=()=>{let e=gulpConfig.get("test.path");return Array.isArray(e)||(e=[e]),_jest.default.runCLI(gulpConfig.get("test.options"),e)};exports.testFull=testFull;
|
package/dist/testHelpers.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const setUp = require('./test-helpers/setUp')
|
|
13
|
-
module.exports = {
|
|
14
|
-
setUp
|
|
15
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
+
Object.defineProperty(exports, '__esModule', {
|
|
5
|
+
value: true
|
|
6
|
+
})
|
|
7
|
+
exports.testHelpers = void 0
|
|
8
|
+
var _testHelpers = _interopRequireWildcard(require('./test-helpers/setUp.js'))
|
|
9
|
+
exports.testHelpers = _testHelpers
|
|
10
|
+
function _getRequireWildcardCache (e) { if (typeof WeakMap !== 'function') return null; var r = new WeakMap(); var t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r })(e) }
|
|
11
|
+
function _interopRequireWildcard (e, r) { if (!r && e && e.__esModule) return e; if (e === null || typeof e !== 'object' && typeof e !== 'function') return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }; var a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (u !== 'default' && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } return n.default = e, t && t.set(e, n), n }
|
package/dist/testHelpers.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.testHelpers=void 0;var _testHelpers=_interopRequireWildcard(require("./test-helpers/setUp.js"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var a=i?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}return n.default=e,t&&t.set(e,n),n}exports.testHelpers=_testHelpers;
|
package/dist/testQuick.js
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.weak-map.delete-all.js')
|
|
4
|
+
Object.defineProperty(exports, '__esModule', {
|
|
5
|
+
value: true
|
|
6
|
+
})
|
|
7
|
+
exports.testQuick = void 0
|
|
8
|
+
var gulpConfig = _interopRequireWildcard(require('../gulp.config.js'))
|
|
9
|
+
var _jest = _interopRequireDefault(require('jest'))
|
|
10
|
+
function _interopRequireDefault (e) { return e && e.__esModule ? e : { default: e } }
|
|
11
|
+
function _getRequireWildcardCache (e) { if (typeof WeakMap !== 'function') return null; var r = new WeakMap(); var t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r })(e) }
|
|
12
|
+
function _interopRequireWildcard (e, r) { if (!r && e && e.__esModule) return e; if (e === null || typeof e !== 'object' && typeof e !== 'function') return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }; var a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (u !== 'default' && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u] } return n.default = e, t && t.set(e, n), n }
|
|
8
13
|
/**
|
|
9
14
|
* Run the Jest tests for files which have been modified (based on git status).
|
|
10
15
|
* Configure where tests are located by using 'testPath'.
|
|
11
16
|
* @memberOf module:js-build-tools
|
|
12
17
|
* @returns {Promise<*>}
|
|
13
|
-
*/
|
|
14
|
-
const testQuick = () => {
|
|
15
|
-
let testPath = gulpConfig.get('test.path')
|
|
16
|
-
if (!Array.isArray(testPath)) {
|
|
17
|
-
// The testPath must be an array of strings
|
|
18
|
-
testPath = [testPath]
|
|
19
|
-
}
|
|
20
|
-
return runCLI({
|
|
21
|
-
onlyChanged: true
|
|
22
|
-
}, testPath)
|
|
23
|
-
}
|
|
24
|
-
|
|
18
|
+
*/
|
|
19
|
+
const testQuick = () => {
|
|
20
|
+
let testPath = gulpConfig.get('test.path')
|
|
21
|
+
if (!Array.isArray(testPath)) {
|
|
22
|
+
// The testPath must be an array of strings
|
|
23
|
+
testPath = [testPath]
|
|
24
|
+
}
|
|
25
|
+
return _jest.default.runCLI({
|
|
26
|
+
onlyChanged: true
|
|
27
|
+
}, testPath)
|
|
28
|
+
}
|
|
29
|
+
exports.testQuick = testQuick
|
package/dist/testQuick.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";require("core-js/modules/esnext.weak-map.delete-all.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.testQuick=void 0;var gulpConfig=_interopRequireWildcard(require("../gulp.config.js")),_jest=_interopRequireDefault(require("jest"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(e){return e?r:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=_getRequireWildcardCache(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var o=i?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(u,n,o):u[n]=e[n]}return u.default=e,r&&r.set(e,u),u}const testQuick=()=>{let e=gulpConfig.get("test.path");return Array.isArray(e)||(e=[e]),_jest.default.runCLI({onlyChanged:!0},e)};exports.testQuick=testQuick;
|
package/dist/typeScript.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.typeScript = void 0
|
|
7
|
+
var _tsFor = require('./partials/tsFor.js')
|
|
5
8
|
/**
|
|
6
9
|
* Simplified typescript task using tsFor.
|
|
7
10
|
* @memberOf module:js-build-tools
|
|
8
11
|
* @returns {Function}
|
|
9
|
-
*/
|
|
10
|
-
const typeScript = tsFor()
|
|
11
|
-
module.exports = typeScript
|
|
12
|
+
*/
|
|
13
|
+
const typeScript = exports.typeScript = (0, _tsFor.tsFor)()
|
package/dist/typeScript.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.typeScript=void 0;var _tsFor=require("./partials/tsFor.js");const typeScript=exports.typeScript=(0,_tsFor.tsFor)();
|
package/dist/utilities/dotGet.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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");
|
|
7
10
|
/**
|
|
8
11
|
* Get a nested property value from an object.
|
|
9
12
|
* Original source concepts from {@link https://github.com/jheagle/si-funciona/blob/main/src/helpers/objects/dotGet.ts Sí, funciona}
|
|
@@ -11,40 +14,39 @@ const strBefore = require('./strBefore');
|
|
|
11
14
|
* @param {string} dotNotation - The path to the property
|
|
12
15
|
* @param {string|null} [defaultValue=null] - The default value to return if the property is not found
|
|
13
16
|
* @returns {*} The value of the property
|
|
14
|
-
*/
|
|
15
|
-
const dotGet = function (arrayObject, dotNotation) {
|
|
16
|
-
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
17
|
-
let key = strBefore(dotNotation, '.');
|
|
18
|
-
const lastKey = !key;
|
|
19
|
-
if (lastKey) {
|
|
20
|
-
key = dotNotation;
|
|
21
|
-
}
|
|
22
|
-
if (key === '*') {
|
|
23
|
-
const result = [];
|
|
24
|
-
for (let wildKey in arrayObject) {
|
|
25
|
-
const wildValue = arrayObject[wildKey];
|
|
26
|
-
if (lastKey) {
|
|
27
|
-
result[wildKey] = wildValue;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (!isObject(wildValue)) {
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
result[wildKey] = dotGet(wildValue, strAfter(dotNotation, '.'), defaultValue);
|
|
34
|
-
}
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
if (lastKey) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
module.exports = dotGet;
|
|
17
|
+
*/
|
|
18
|
+
const dotGet = function (arrayObject, dotNotation) {
|
|
19
|
+
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
20
|
+
let key = (0, _strBefore.strBefore)(dotNotation, '.');
|
|
21
|
+
const lastKey = !key;
|
|
22
|
+
if (lastKey) {
|
|
23
|
+
key = dotNotation;
|
|
24
|
+
}
|
|
25
|
+
if (key === '*') {
|
|
26
|
+
const result = [];
|
|
27
|
+
for (let wildKey in arrayObject) {
|
|
28
|
+
const wildValue = arrayObject[wildKey];
|
|
29
|
+
if (lastKey) {
|
|
30
|
+
result[wildKey] = wildValue;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (!(0, _isObject.isObject)(wildValue)) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
result[wildKey] = dotGet(wildValue, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
if (lastKey) {
|
|
41
|
+
return arrayObject[dotNotation] ?? defaultValue;
|
|
42
|
+
}
|
|
43
|
+
if (typeof arrayObject[key] === 'undefined') {
|
|
44
|
+
return defaultValue;
|
|
45
|
+
}
|
|
46
|
+
const next = arrayObject[key];
|
|
47
|
+
if (!(0, _isObject.isObject)(next)) {
|
|
48
|
+
return defaultValue;
|
|
49
|
+
}
|
|
50
|
+
return dotGet(next, (0, _strAfter.strAfter)(dotNotation, '.'), defaultValue);
|
|
51
|
+
};
|
|
52
|
+
exports.dotGet = dotGet;
|