jscrambler 5.5.34 → 6.0.4
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 +17 -0
- package/dist/bin/jscrambler.js +8 -10
- package/dist/client.js +15 -1
- package/dist/config.js +3 -1
- package/dist/constants.js +24 -2
- package/dist/generate-signed-params.js +5 -1
- package/dist/index.js +168 -169
- package/dist/utils.js +33 -0
- package/package.json +1 -1
package/dist/utils.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getMatchedFiles = getMatchedFiles;
|
|
7
|
+
|
|
8
|
+
var _glob = require('glob');
|
|
9
|
+
|
|
10
|
+
var _glob2 = _interopRequireDefault(_glob);
|
|
11
|
+
|
|
12
|
+
var _fs = require('fs');
|
|
13
|
+
|
|
14
|
+
var _fs2 = _interopRequireDefault(_fs);
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Return the list of matched files for minimatch patterns.
|
|
20
|
+
* @param {string} pattern
|
|
21
|
+
* @returns {string[]}
|
|
22
|
+
*/
|
|
23
|
+
function getMatchedFiles(pattern) {
|
|
24
|
+
var matchedFiles = _glob2.default.sync(pattern, {
|
|
25
|
+
dot: true
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// special case when the real file name contains a minimatch expression (f.e [id]-1234.js)
|
|
29
|
+
if (matchedFiles.length === 0 && _fs2.default.existsSync(pattern)) {
|
|
30
|
+
matchedFiles = [pattern];
|
|
31
|
+
}
|
|
32
|
+
return matchedFiles;
|
|
33
|
+
}
|