diff options
Diffstat (limited to 'node_modules/copy-webpack-plugin/dist/utils')
6 files changed, 121 insertions, 0 deletions
diff --git a/node_modules/copy-webpack-plugin/dist/utils/escape.js b/node_modules/copy-webpack-plugin/dist/utils/escape.js new file mode 100644 index 00000000..ac900b69 --- /dev/null +++ b/node_modules/copy-webpack-plugin/dist/utils/escape.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = escape; + +var _path = require('path'); + +var _path2 = _interopRequireDefault(_path); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function escape(context, from) { + if (from && _path2.default.isAbsolute(from)) { + return from; + } else { + // Ensure context is escaped before globbing + // Handles special characters in paths + var absoluteContext = _path2.default.resolve(context).replace(/[\*|\?|\!|\(|\)|\[|\]|\{|\}]/g, function (substring) { + return '[' + substring + ']'; + }); + + if (!from) { + return absoluteContext; + } + + // Cannot use path.join/resolve as it "fixes" the path separators + if (absoluteContext.endsWith('/')) { + return '' + absoluteContext + from; + } else { + return absoluteContext + '/' + from; + } + } +}
\ No newline at end of file diff --git a/node_modules/copy-webpack-plugin/dist/utils/isObject.js b/node_modules/copy-webpack-plugin/dist/utils/isObject.js new file mode 100644 index 00000000..e033557d --- /dev/null +++ b/node_modules/copy-webpack-plugin/dist/utils/isObject.js @@ -0,0 +1,9 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (val) { + return Object.prototype.toString.call(val) === '[object Object]' ? true : false; +};
\ No newline at end of file diff --git a/node_modules/copy-webpack-plugin/dist/utils/promisify.js b/node_modules/copy-webpack-plugin/dist/utils/promisify.js new file mode 100644 index 00000000..a49fc55b --- /dev/null +++ b/node_modules/copy-webpack-plugin/dist/utils/promisify.js @@ -0,0 +1,26 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var stat = exports.stat = function stat(inputFileSystem, path) { + return new Promise(function (resolve, reject) { + inputFileSystem.stat(path, function (err, stats) { + if (err) { + reject(err); + } + resolve(stats); + }); + }); +}; + +var readFile = exports.readFile = function readFile(inputFileSystem, path) { + return new Promise(function (resolve, reject) { + inputFileSystem.readFile(path, function (err, stats) { + if (err) { + reject(err); + } + resolve(stats); + }); + }); +};
\ No newline at end of file diff --git a/node_modules/copy-webpack-plugin/dist/utils/readFilePromise.js b/node_modules/copy-webpack-plugin/dist/utils/readFilePromise.js new file mode 100644 index 00000000..cc266272 --- /dev/null +++ b/node_modules/copy-webpack-plugin/dist/utils/readFilePromise.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (inputFileSystem, path) { + return new Promise(function (resolve, reject) { + inputFileSystem.readFile(path, function (err, stats) { + if (err) { + return reject(err); + } + + return resolve(stats); + }); + }); +};
\ No newline at end of file diff --git a/node_modules/copy-webpack-plugin/dist/utils/readPromise.js b/node_modules/copy-webpack-plugin/dist/utils/readPromise.js new file mode 100644 index 00000000..cc266272 --- /dev/null +++ b/node_modules/copy-webpack-plugin/dist/utils/readPromise.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (inputFileSystem, path) { + return new Promise(function (resolve, reject) { + inputFileSystem.readFile(path, function (err, stats) { + if (err) { + return reject(err); + } + + return resolve(stats); + }); + }); +};
\ No newline at end of file diff --git a/node_modules/copy-webpack-plugin/dist/utils/statPromise.js b/node_modules/copy-webpack-plugin/dist/utils/statPromise.js new file mode 100644 index 00000000..4f421bfb --- /dev/null +++ b/node_modules/copy-webpack-plugin/dist/utils/statPromise.js @@ -0,0 +1,17 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (inputFileSystem, path) { + return new Promise(function (resolve, reject) { + inputFileSystem.stat(path, function (err, stats) { + if (err) { + return reject(err); + } + + return resolve(stats); + }); + }); +};
\ No newline at end of file |
