aboutsummaryrefslogtreecommitdiff
path: root/node_modules/copy-webpack-plugin/dist/utils
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:38:48 +0800
committerruki <waruqi@gmail.com>2018-11-07 21:53:09 +0800
commit26105034da4fcce7ac883c899d781f016559310d (patch)
treec459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/copy-webpack-plugin/dist/utils
parent2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff)
downloadxmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz
xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip
switch to vuepress
Diffstat (limited to 'node_modules/copy-webpack-plugin/dist/utils')
-rw-r--r--node_modules/copy-webpack-plugin/dist/utils/escape.js35
-rw-r--r--node_modules/copy-webpack-plugin/dist/utils/isObject.js9
-rw-r--r--node_modules/copy-webpack-plugin/dist/utils/promisify.js26
-rw-r--r--node_modules/copy-webpack-plugin/dist/utils/readFilePromise.js17
-rw-r--r--node_modules/copy-webpack-plugin/dist/utils/readPromise.js17
-rw-r--r--node_modules/copy-webpack-plugin/dist/utils/statPromise.js17
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