balm-core 3.19.0 → 3.21.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/index.d.ts +3 -0
- package/lib/balm.js +5 -1
- package/lib/bootstrap/index.js +1 -4
- package/lib/bundler/esbuild/transform.js +39 -45
- package/lib/bundler/rollup/index.js +37 -43
- package/lib/bundler/webpack/config/common.js +2 -2
- package/lib/bundler/webpack/config/prod.js +4 -13
- package/lib/bundler/webpack/config/regex.js +1 -1
- package/lib/bundler/webpack/index.js +1 -1
- package/lib/bundler/webpack/output.js +1 -1
- package/lib/config/constants.js +1 -1
- package/lib/config/index.js +0 -1
- package/lib/index.js +5 -5
- package/lib/middlewares/proxy.js +3 -1
- package/lib/plugins/less.js +55 -4
- package/lib/plugins/plumber.js +1 -1
- package/lib/plugins/postcss.js +1 -0
- package/lib/plugins/replace.js +2 -2
- package/lib/plugins/sass.js +8 -16
- package/lib/tasks/foundation/balm_style.js +1 -1
- package/lib/tasks/index.js +3 -1
- package/lib/tasks/private/build.js +3 -1
- package/lib/tasks/private/cache.js +4 -2
- package/lib/tasks/private/clean.js +5 -1
- package/lib/tasks/private/extra.js +3 -1
- package/lib/tasks/private/font.js +3 -1
- package/lib/tasks/private/image.js +3 -1
- package/lib/tasks/private/lint.js +3 -1
- package/lib/tasks/private/media.js +3 -1
- package/lib/tasks/private/modernizr.js +10 -4
- package/lib/tasks/private/sprite.js +6 -2
- package/lib/tasks/private/start.js +3 -1
- package/lib/tasks/private/workbox-sw.js +3 -1
- package/lib/tasks/public/ftp.js +3 -1
- package/lib/tasks/public/html.js +6 -2
- package/lib/tasks/public/publish.js +5 -1
- package/lib/tasks/public/remove.js +5 -1
- package/lib/tasks/public/server.js +9 -3
- package/lib/tasks/public/url.js +5 -1
- package/lib/utilities/cache-core.js +4 -3
- package/lib/utilities/compiling.js +5 -1
- package/lib/utilities/loading.js +7 -3
- package/lib/utilities/logger.js +5 -1
- package/package.json +32 -32
- package/tslib/balm.js +9 -9
- package/tslib/bootstrap/index.js +4 -6
- package/tslib/bundler/esbuild/index.js +4 -4
- package/tslib/bundler/esbuild/transform.js +2 -2
- package/tslib/bundler/rollup/entry.js +1 -1
- package/tslib/bundler/rollup/index.js +8 -8
- package/tslib/bundler/rollup/output.js +1 -1
- package/tslib/bundler/webpack/config/common.js +4 -4
- package/tslib/bundler/webpack/config/dev.js +3 -3
- package/tslib/bundler/webpack/config/index.js +4 -4
- package/tslib/bundler/webpack/config/prod.js +5 -14
- package/tslib/bundler/webpack/index.js +8 -8
- package/tslib/bundler/webpack/loaders.js +4 -4
- package/tslib/bundler/webpack/output.js +1 -1
- package/tslib/config/globals.js +3 -3
- package/tslib/config/index.js +13 -14
- package/tslib/config/version.js +1 -1
- package/tslib/hello.js +2 -2
- package/tslib/hooks/index.js +1 -1
- package/tslib/index.js +2 -2
- package/tslib/middlewares/index.js +6 -6
- package/tslib/middlewares/proxy.js +2 -1
- package/tslib/plugins/imagemin.js +6 -4
- package/tslib/plugins/index.js +11 -11
- package/tslib/plugins/less.js +54 -9
- package/tslib/plugins/postcss.js +2 -2
- package/tslib/plugins/replace.js +2 -2
- package/tslib/plugins/sass.js +13 -12
- package/tslib/plugins/sftp.js +1 -1
- package/tslib/tasks/foundation/balm_style.js +2 -2
- package/tslib/tasks/foundation/index.js +2 -2
- package/tslib/tasks/index.js +7 -6
- package/tslib/tasks/private/cache.js +1 -1
- package/tslib/tasks/private/clean.js +2 -2
- package/tslib/tasks/private/image.js +1 -1
- package/tslib/tasks/private/modernizr.js +4 -4
- package/tslib/tasks/private/sprite.js +5 -5
- package/tslib/tasks/public/esbuild.js +2 -2
- package/tslib/tasks/public/ftp.js +2 -1
- package/tslib/tasks/public/html.js +5 -5
- package/tslib/tasks/public/publish.js +4 -4
- package/tslib/tasks/public/remove.js +1 -1
- package/tslib/tasks/public/rollup.js +2 -2
- package/tslib/tasks/public/server.js +13 -12
- package/tslib/tasks/public/url.js +2 -2
- package/tslib/tasks/public/webpack.js +2 -2
- package/tslib/utilities/address.js +1 -1
- package/tslib/utilities/cache-core.js +10 -9
- package/tslib/utilities/color.js +1 -1
- package/tslib/utilities/compiling.js +4 -4
- package/tslib/utilities/detect-port.js +2 -2
- package/tslib/utilities/file.js +3 -3
- package/tslib/utilities/index.js +4 -4
- package/tslib/utilities/loading.js +9 -8
- package/tslib/utilities/logger.js +9 -9
- package/tslib/utilities/replacestream.js +3 -3
- package/tslib/utilities/utils.js +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const os_1 = tslib_1.__importDefault(require("os"));
|
|
4
|
+
const os_1 = (0, tslib_1.__importDefault)(require("os"));
|
|
5
5
|
const platform = os_1.default.platform();
|
|
6
6
|
function getInterfaceName() {
|
|
7
7
|
let val = 'eth';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const module_1 = tslib_1.__importDefault(require("module"));
|
|
5
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
4
|
+
const module_1 = (0, tslib_1.__importDefault)(require("module"));
|
|
5
|
+
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
6
6
|
const os_1 = require("os");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
|
-
const loading_1 = tslib_1.__importDefault(require("./loading"));
|
|
8
|
+
const loading_1 = (0, tslib_1.__importDefault)(require("./loading"));
|
|
9
9
|
const _require = module_1.default.prototype.require;
|
|
10
|
-
const SAVE_FILE = path_1.default.join(os_1.homedir(), process.env.BALM_CORE_CACHE || '.balm-core-cache.json');
|
|
10
|
+
const SAVE_FILE = path_1.default.join((0, os_1.homedir)(), process.env.BALM_CORE_CACHE || '.balm-core-cache.json');
|
|
11
11
|
function cacheBalmCore() {
|
|
12
12
|
let nameCache;
|
|
13
13
|
let originLastFilename;
|
|
14
14
|
try {
|
|
15
|
-
nameCache = fs_1.existsSync(SAVE_FILE)
|
|
16
|
-
? JSON.parse(fs_1.readFileSync(SAVE_FILE, 'utf-8'))
|
|
15
|
+
nameCache = (0, fs_1.existsSync)(SAVE_FILE)
|
|
16
|
+
? JSON.parse((0, fs_1.readFileSync)(SAVE_FILE, 'utf-8'))
|
|
17
17
|
: {};
|
|
18
18
|
originLastFilename = nameCache.lastFilename || '';
|
|
19
19
|
}
|
|
@@ -33,7 +33,7 @@ function cacheBalmCore() {
|
|
|
33
33
|
}
|
|
34
34
|
if (currentModuleCache[name] &&
|
|
35
35
|
typeof currentModuleCache[name] === 'string' &&
|
|
36
|
-
fs_1.existsSync(currentModuleCache[name])) {
|
|
36
|
+
(0, fs_1.existsSync)(currentModuleCache[name])) {
|
|
37
37
|
pathToLoad = currentModuleCache[name];
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
@@ -48,9 +48,10 @@ function cacheBalmCore() {
|
|
|
48
48
|
BalmJS.emitter.once('exit', function () {
|
|
49
49
|
if (nameCache.lastFilename !== originLastFilename) {
|
|
50
50
|
try {
|
|
51
|
-
fs_1.writeFileSync(SAVE_FILE, JSON.stringify(nameCache, null, 2), 'utf-8');
|
|
51
|
+
(0, fs_1.writeFileSync)(SAVE_FILE, JSON.stringify(nameCache, null, 2), 'utf-8');
|
|
52
52
|
}
|
|
53
|
-
catch (
|
|
53
|
+
catch (error) {
|
|
54
|
+
const err = error;
|
|
54
55
|
console.error(`BalmJS: Failed saving cache: ${err.toString()}`);
|
|
55
56
|
}
|
|
56
57
|
}
|
package/tslib/utilities/color.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const ansi_colors_1 = tslib_1.__importDefault(require("ansi-colors"));
|
|
4
|
+
const ansi_colors_1 = (0, tslib_1.__importDefault)(require("ansi-colors"));
|
|
5
5
|
const COLOR = {
|
|
6
6
|
PREFIX: 'bg',
|
|
7
7
|
SUFFIX: 'Bright'
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
var _BalmCompiling_firstCompile;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const loading_1 = tslib_1.__importDefault(require("./loading"));
|
|
5
|
+
const loading_1 = (0, tslib_1.__importDefault)(require("./loading"));
|
|
6
6
|
class BalmCompiling {
|
|
7
7
|
constructor() {
|
|
8
8
|
_BalmCompiling_firstCompile.set(this, true);
|
|
9
9
|
}
|
|
10
10
|
start() {
|
|
11
|
-
if (tslib_1.__classPrivateFieldGet(this, _BalmCompiling_firstCompile, "f")) {
|
|
11
|
+
if ((0, tslib_1.__classPrivateFieldGet)(this, _BalmCompiling_firstCompile, "f")) {
|
|
12
12
|
loading_1.default.render('Compiling to JS...');
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
stop() {
|
|
16
|
-
if (tslib_1.__classPrivateFieldGet(this, _BalmCompiling_firstCompile, "f")) {
|
|
17
|
-
tslib_1.__classPrivateFieldSet(this, _BalmCompiling_firstCompile, false, "f");
|
|
16
|
+
if ((0, tslib_1.__classPrivateFieldGet)(this, _BalmCompiling_firstCompile, "f")) {
|
|
17
|
+
(0, tslib_1.__classPrivateFieldSet)(this, _BalmCompiling_firstCompile, false, "f");
|
|
18
18
|
loading_1.default.clear();
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const net_1 = tslib_1.__importDefault(require("net"));
|
|
5
|
-
const address_1 = tslib_1.__importDefault(require("./address"));
|
|
4
|
+
const net_1 = (0, tslib_1.__importDefault)(require("net"));
|
|
5
|
+
const address_1 = (0, tslib_1.__importDefault)(require("./address"));
|
|
6
6
|
const UTIL_NAME = 'detect port';
|
|
7
7
|
const MAX_PORT = 65535;
|
|
8
8
|
function listen(port, host, callback) {
|
package/tslib/utilities/file.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
5
|
-
const public_url_1 = tslib_1.__importDefault(require("./public-url"));
|
|
4
|
+
const fs_1 = (0, tslib_1.__importDefault)(require("fs"));
|
|
5
|
+
const public_url_1 = (0, tslib_1.__importDefault)(require("./public-url"));
|
|
6
6
|
const constants_1 = require("../config/constants");
|
|
7
7
|
const appDirectory = fs_1.default.realpathSync(process.cwd());
|
|
8
8
|
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);
|
|
9
9
|
class File {
|
|
10
10
|
get publicUrlOrPath() {
|
|
11
|
-
return public_url_1.default(require(resolveApp('package.json')).homepage, process.env.PUBLIC_URL);
|
|
11
|
+
return (0, public_url_1.default)(require(resolveApp('package.json')).homepage, process.env.PUBLIC_URL);
|
|
12
12
|
}
|
|
13
13
|
get stylePaths() {
|
|
14
14
|
return [
|
package/tslib/utilities/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const utils_1 = tslib_1.__importDefault(require("./utils"));
|
|
5
|
-
const logger_1 = tslib_1.__importDefault(require("./logger"));
|
|
6
|
-
const file_1 = tslib_1.__importDefault(require("./file"));
|
|
7
|
-
const namespace_1 = tslib_1.__importDefault(require("./namespace"));
|
|
4
|
+
const utils_1 = (0, tslib_1.__importDefault)(require("./utils"));
|
|
5
|
+
const logger_1 = (0, tslib_1.__importDefault)(require("./logger"));
|
|
6
|
+
const file_1 = (0, tslib_1.__importDefault)(require("./file"));
|
|
7
|
+
const namespace_1 = (0, tslib_1.__importDefault)(require("./namespace"));
|
|
8
8
|
BalmJS.utils = utils_1.default;
|
|
9
9
|
BalmJS.logger = logger_1.default;
|
|
10
10
|
BalmJS.file = file_1.default;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
var _BalmLoading_stream, _BalmLoading_frameIndex, _BalmLoading_frameCount;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const readline_1 = tslib_1.__importDefault(require("readline"));
|
|
6
|
-
const spinner_1 = tslib_1.__importDefault(require("../config/spinner"));
|
|
7
|
-
const version_1 = tslib_1.__importDefault(require("../config/version"));
|
|
5
|
+
const readline_1 = (0, tslib_1.__importDefault)(require("readline"));
|
|
6
|
+
const spinner_1 = (0, tslib_1.__importDefault)(require("../config/spinner"));
|
|
7
|
+
const version_1 = (0, tslib_1.__importDefault)(require("../config/version"));
|
|
8
8
|
class BalmLoading {
|
|
9
9
|
constructor() {
|
|
10
10
|
_BalmLoading_stream.set(this, process.stderr);
|
|
@@ -12,17 +12,18 @@ class BalmLoading {
|
|
|
12
12
|
_BalmLoading_frameCount.set(this, spinner_1.default.frames.length);
|
|
13
13
|
}
|
|
14
14
|
get frame() {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var _a;
|
|
16
|
+
const currentFrame = spinner_1.default.frames[(0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_frameIndex, "f")];
|
|
17
|
+
(0, tslib_1.__classPrivateFieldSet)(this, _BalmLoading_frameIndex, (0, tslib_1.__classPrivateFieldSet)(this, _BalmLoading_frameIndex, (_a = (0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_frameIndex, "f"), ++_a), "f") % (0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_frameCount, "f"), "f");
|
|
17
18
|
return currentFrame;
|
|
18
19
|
}
|
|
19
20
|
clear() {
|
|
20
|
-
readline_1.default.clearLine(tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f"), 0);
|
|
21
|
-
readline_1.default.cursorTo(tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f"), 0);
|
|
21
|
+
readline_1.default.clearLine((0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_stream, "f"), 0);
|
|
22
|
+
readline_1.default.cursorTo((0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_stream, "f"), 0);
|
|
22
23
|
}
|
|
23
24
|
render(text = `${this.frame} BalmJS is initializing...`) {
|
|
24
25
|
this.clear();
|
|
25
|
-
tslib_1.__classPrivateFieldGet(this, _BalmLoading_stream, "f").write(text);
|
|
26
|
+
(0, tslib_1.__classPrivateFieldGet)(this, _BalmLoading_stream, "f").write(text);
|
|
26
27
|
}
|
|
27
28
|
succeed() {
|
|
28
29
|
this.clear();
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
var _Logger_log;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const util_1 = tslib_1.__importDefault(require("util"));
|
|
6
|
-
const fancy_log_1 = tslib_1.__importDefault(require("fancy-log"));
|
|
7
|
-
const color_1 = tslib_1.__importDefault(require("./color"));
|
|
5
|
+
const util_1 = (0, tslib_1.__importDefault)(require("util"));
|
|
6
|
+
const fancy_log_1 = (0, tslib_1.__importDefault)(require("fancy-log"));
|
|
7
|
+
const color_1 = (0, tslib_1.__importDefault)(require("./color"));
|
|
8
8
|
const LOG = {
|
|
9
9
|
FORMAT: '%s %s %s',
|
|
10
|
-
PREFIX: color_1.default('BalmJS', {
|
|
10
|
+
PREFIX: (0, color_1.default)('BalmJS', {
|
|
11
11
|
color: 'blue',
|
|
12
12
|
background: true,
|
|
13
13
|
bright: true
|
|
@@ -57,7 +57,7 @@ class Logger {
|
|
|
57
57
|
}, options);
|
|
58
58
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
59
59
|
console.log(LOG.beginning);
|
|
60
|
-
fancy_log_1.default(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.OK), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
60
|
+
(0, fancy_log_1.default)(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.OK), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
61
61
|
console.log(LOG.end);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -66,7 +66,7 @@ class Logger {
|
|
|
66
66
|
logLevel: BalmJS.LogLevel.Debug
|
|
67
67
|
}, options);
|
|
68
68
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
69
|
-
fancy_log_1.default.info(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.DEBUG), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
69
|
+
fancy_log_1.default.info(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.DEBUG), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
info(label, message, options = {}) {
|
|
@@ -74,7 +74,7 @@ class Logger {
|
|
|
74
74
|
logLevel: BalmJS.LogLevel.Info
|
|
75
75
|
}, options);
|
|
76
76
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
77
|
-
fancy_log_1.default.info(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.INFO), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
77
|
+
fancy_log_1.default.info(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.INFO), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
warn(label, message, options = {}) {
|
|
@@ -82,7 +82,7 @@ class Logger {
|
|
|
82
82
|
logLevel: BalmJS.LogLevel.Warn
|
|
83
83
|
}, options);
|
|
84
84
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
85
|
-
fancy_log_1.default.warn(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.WARN), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
85
|
+
fancy_log_1.default.warn(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.WARN), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
error(label, message, options = {}) {
|
|
@@ -91,7 +91,7 @@ class Logger {
|
|
|
91
91
|
pre: false
|
|
92
92
|
}, options);
|
|
93
93
|
if (BalmJS.config.logs.level <= logOptions.logLevel) {
|
|
94
|
-
fancy_log_1.default.error(LOG.FORMAT, LOG.PREFIX, color_1.default(`<${label}>`, LOG.ERROR), tslib_1.__classPrivateFieldGet(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
94
|
+
fancy_log_1.default.error(LOG.FORMAT, LOG.PREFIX, (0, color_1.default)(`<${label}>`, LOG.ERROR), (0, tslib_1.__classPrivateFieldGet)(this, _Logger_log, "f").call(this, message, logOptions.pre));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const escape_string_regexp_1 = tslib_1.__importDefault(require("./escape-string-regexp"));
|
|
4
|
+
const escape_string_regexp_1 = (0, tslib_1.__importDefault)(require("./escape-string-regexp"));
|
|
5
5
|
function createReplaceFn(replace, isRegEx) {
|
|
6
6
|
function regexReplaceFunction(...args) {
|
|
7
7
|
let newReplace = replace;
|
|
@@ -31,9 +31,9 @@ function matchFromRegex(regex, options) {
|
|
|
31
31
|
}
|
|
32
32
|
function matchFromString(str, options) {
|
|
33
33
|
if (options.regExpFlags) {
|
|
34
|
-
return new RegExp(escape_string_regexp_1.default(str), options.regExpFlags);
|
|
34
|
+
return new RegExp((0, escape_string_regexp_1.default)(str), options.regExpFlags);
|
|
35
35
|
}
|
|
36
|
-
return new RegExp(escape_string_regexp_1.default(str), options.ignoreCase ? 'gmi' : 'gm');
|
|
36
|
+
return new RegExp((0, escape_string_regexp_1.default)(str), options.ignoreCase ? 'gmi' : 'gm');
|
|
37
37
|
}
|
|
38
38
|
function replaceStream(search, replace, opts) {
|
|
39
39
|
const readableStream = require('readable-stream');
|
package/tslib/utilities/utils.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const typeof_1 = tslib_1.__importDefault(require("./typeof"));
|
|
4
|
+
const typeof_1 = (0, tslib_1.__importDefault)(require("./typeof"));
|
|
5
5
|
function isString(str) {
|
|
6
|
-
return typeof_1.default(str) === 'string';
|
|
6
|
+
return (0, typeof_1.default)(str) === 'string';
|
|
7
7
|
}
|
|
8
8
|
function isObject(obj) {
|
|
9
|
-
return typeof_1.default(obj) === 'object';
|
|
9
|
+
return (0, typeof_1.default)(obj) === 'object';
|
|
10
10
|
}
|
|
11
11
|
function isArray(arr) {
|
|
12
12
|
return Array.isArray(arr);
|
|
13
13
|
}
|
|
14
14
|
function isFunction(fn) {
|
|
15
|
-
const type = typeof_1.default(fn);
|
|
15
|
+
const type = (0, typeof_1.default)(fn);
|
|
16
16
|
return type === 'function' || type === 'generatorfunction';
|
|
17
17
|
}
|
|
18
18
|
function deepMerge(target, source) {
|