jscrambler 6.2.6 → 6.3.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/dist/zip.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -14,120 +13,87 @@ Object.defineProperty(exports, "outputFileSync", {
14
13
  exports.unzip = unzip;
15
14
  exports.zip = zip;
16
15
  exports.zipSources = zipSources;
17
-
18
16
  var _lodash = _interopRequireDefault(require("lodash.size"));
19
-
20
17
  var _temp = _interopRequireDefault(require("temp"));
21
-
22
18
  var _jszip = _interopRequireDefault(require("jszip"));
23
-
24
19
  var _fsExtra = require("fs-extra");
25
-
26
20
  var _path2 = require("path");
27
-
28
21
  var _q = require("q");
29
-
30
22
  var _util = require("util");
31
-
32
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
-
34
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
35
-
24
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
36
25
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
37
-
38
26
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
39
-
40
27
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
41
-
42
28
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
43
-
44
29
  function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
45
-
46
30
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
-
48
31
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
49
-
50
32
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
33
+ var debug = !!process.env.DEBUG;
51
34
 
52
- var debug = !!process.env.DEBUG; // ./zip.js module is excluded from browser-like environments. We take advantage of that here.
53
-
35
+ // ./zip.js module is excluded from browser-like environments. We take advantage of that here.
54
36
  function zip(_x, _x2) {
55
37
  return _zip.apply(this, arguments);
56
38
  }
57
-
58
39
  function _zip() {
59
40
  _zip = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(files, cwd) {
60
41
  var deferred, hasFiles, _zip2, zipFile, _zip3, i, l, buffer, name, sPath;
61
-
62
42
  return _regeneratorRuntime().wrap(function _callee$(_context) {
63
43
  while (1) {
64
44
  switch (_context.prev = _context.next) {
65
45
  case 0:
66
46
  debug && console.log('Zipping files', (0, _util.inspect)(files));
67
47
  deferred = (0, _q.defer)(); // Flag to detect if any file was added to the zip archive
68
-
69
48
  hasFiles = false; // Sanitize `cwd`
70
-
71
49
  if (cwd) {
72
50
  cwd = (0, _path2.normalize)(cwd);
73
- } // If it's already a zip file
74
-
75
-
51
+ }
52
+ // If it's already a zip file
76
53
  if (!(files.length === 1 && /^.*\.zip$/.test(files[0]))) {
77
54
  _context.next = 14;
78
55
  break;
79
56
  }
80
-
81
57
  hasFiles = true;
82
58
  _zip2 = new _jszip.default();
83
59
  zipFile = (0, _fsExtra.readFileSync)(files[0]);
84
60
  _context.next = 10;
85
61
  return _zip2.loadAsync(zipFile);
86
-
87
62
  case 10:
88
63
  zipFile = _context.sent;
89
64
  deferred.resolve(zipFile);
90
65
  _context.next = 31;
91
66
  break;
92
-
93
67
  case 14:
94
68
  _zip3 = new _jszip.default();
95
69
  i = 0, l = files.length;
96
-
97
70
  case 16:
98
71
  if (!(i < l)) {
99
72
  _context.next = 28;
100
73
  break;
101
74
  }
102
-
103
75
  // Sanitise path
104
76
  if (typeof files[i] === 'string') {
105
77
  files[i] = (0, _path2.normalize)(files[i]);
106
-
107
78
  if (files[i].indexOf('../') === 0) {
108
79
  files[i] = (0, _path2.resolve)(files[i]);
109
80
  }
110
- } // Bypass unwanted patterns from `files`
111
-
112
-
81
+ }
82
+ // Bypass unwanted patterns from `files`
113
83
  if (!/.*\.(git|hg)(\/.*|$)/.test(files[i].path || files[i])) {
114
84
  _context.next = 20;
115
85
  break;
116
86
  }
117
-
118
87
  return _context.abrupt("continue", 25);
119
-
120
88
  case 20:
121
89
  buffer = void 0, name = void 0;
122
90
  sPath = void 0;
123
-
124
91
  if (cwd && files[i].indexOf && files[i].indexOf(cwd) !== 0) {
125
92
  sPath = (0, _path2.join)(cwd, files[i]);
126
93
  } else {
127
94
  sPath = files[i];
128
- } // If buffer
129
-
130
-
95
+ }
96
+ // If buffer
131
97
  if (files[i].contents) {
132
98
  name = (0, _path2.relative)(files[i].cwd, files[i].path);
133
99
  buffer = files[i].contents;
@@ -138,38 +104,29 @@ function _zip() {
138
104
  } else {
139
105
  name = files[i];
140
106
  }
141
-
142
107
  buffer = (0, _fsExtra.readFileSync)(sPath);
143
108
  } else {
144
109
  // Else if it's a directory path
145
110
  _zip3.folder(sPath);
146
111
  }
147
-
148
112
  if (name) {
149
113
  hasFiles = true;
150
-
151
114
  _zip3.file(name, buffer);
152
115
  }
153
-
154
116
  case 25:
155
117
  ++i;
156
118
  _context.next = 16;
157
119
  break;
158
-
159
120
  case 28:
160
121
  if (hasFiles) {
161
122
  _context.next = 30;
162
123
  break;
163
124
  }
164
-
165
125
  throw new Error('No source files found. If you intend to send a whole directory sufix your path with "**" (e.g. ./my-directory/**)');
166
-
167
126
  case 30:
168
127
  deferred.resolve(_zip3);
169
-
170
128
  case 31:
171
129
  return _context.abrupt("return", deferred.promise);
172
-
173
130
  case 32:
174
131
  case "end":
175
132
  return _context.stop();
@@ -179,55 +136,46 @@ function _zip() {
179
136
  }));
180
137
  return _zip.apply(this, arguments);
181
138
  }
182
-
183
139
  function zipSources(sources) {
184
140
  var zipFile = new _jszip.default();
185
141
  var fileNames = sources.map(function (source) {
186
142
  zipFile.file(source.filename, source.content);
187
143
  return source.filename;
188
144
  });
189
-
190
145
  if (debug) {
191
146
  console.log('Zipping files', (0, _util.inspect)(fileNames));
192
147
  }
193
-
194
148
  return Promise.resolve(zipFile);
195
149
  }
196
-
197
150
  function isWinAbsolutePath(path) {
198
151
  return (0, _path2.isAbsolute)(path) && /^([a-z]:)(.*)/i.test(path);
199
152
  }
200
-
201
153
  function parseWinAbsolutePath(_path) {
202
154
  var _path$match = _path.match(/^([a-z]:)(.*)/i),
203
- _path$match2 = _slicedToArray(_path$match, 3),
204
- full = _path$match2[0],
205
- drv = _path$match2[1],
206
- path = _path$match2[2];
207
-
155
+ _path$match2 = _slicedToArray(_path$match, 3),
156
+ full = _path$match2[0],
157
+ drv = _path$match2[1],
158
+ path = _path$match2[2];
208
159
  return {
209
160
  drv: drv,
210
161
  path: path
211
162
  };
212
163
  }
213
-
214
164
  function unzip(_x3, _x4) {
215
165
  return _unzip.apply(this, arguments);
216
166
  }
217
-
218
167
  function _unzip() {
219
168
  _unzip = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(zipFile, dest) {
220
169
  var stream,
221
- zip,
222
- _size,
223
- results,
224
- file,
225
- buffer,
226
- destPath,
227
- lastDestChar,
228
- _file,
229
- _args2 = arguments;
230
-
170
+ zip,
171
+ _size,
172
+ results,
173
+ file,
174
+ buffer,
175
+ destPath,
176
+ lastDestChar,
177
+ _file,
178
+ _args2 = arguments;
231
179
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
232
180
  while (1) {
233
181
  switch (_context2.prev = _context2.next) {
@@ -236,31 +184,24 @@ function _unzip() {
236
184
  zip = new _jszip.default();
237
185
  _context2.next = 4;
238
186
  return zip.loadAsync(zipFile);
239
-
240
187
  case 4:
241
188
  _size = (0, _lodash.default)(zip.files);
242
189
  results = [];
243
190
  _context2.t0 = _regeneratorRuntime().keys(zip.files);
244
-
245
191
  case 7:
246
192
  if ((_context2.t1 = _context2.t0()).done) {
247
193
  _context2.next = 16;
248
194
  break;
249
195
  }
250
-
251
196
  file = _context2.t1.value;
252
-
253
197
  if (zip.files[file].dir) {
254
198
  _context2.next = 14;
255
199
  break;
256
200
  }
257
-
258
201
  _context2.next = 12;
259
202
  return zip.file(file).async('nodebuffer');
260
-
261
203
  case 12:
262
204
  buffer = _context2.sent;
263
-
264
205
  if (typeof dest === 'function') {
265
206
  if (stream) {
266
207
  dest(buffer, file);
@@ -272,31 +213,24 @@ function _unzip() {
272
213
  }
273
214
  } else if (dest && typeof dest === 'string') {
274
215
  lastDestChar = dest[dest.length - 1];
275
-
276
216
  if (_size === 1 && lastDestChar !== '/' && lastDestChar !== '\\') {
277
217
  destPath = dest;
278
218
  } else {
279
219
  _file = file; // Deal with win path join c:\dest\:c\src
280
-
281
220
  if (isWinAbsolutePath(_file)) {
282
221
  _file = parseWinAbsolutePath(_file).path;
283
222
  }
284
-
285
223
  destPath = (0, _path2.join)(dest, _file);
286
224
  }
287
-
288
225
  (0, _fsExtra.outputFileSync)(destPath, buffer);
289
226
  }
290
-
291
227
  case 14:
292
228
  _context2.next = 7;
293
229
  break;
294
-
295
230
  case 16:
296
231
  if (!stream) {
297
232
  dest(results);
298
233
  }
299
-
300
234
  case 17:
301
235
  case "end":
302
236
  return _context2.stop();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jscrambler",
3
3
  "description": "Jscrambler API client.",
4
- "version": "6.2.6",
4
+ "version": "6.3.0",
5
5
  "homepage": "https://github.com/jscrambler/jscrambler",
6
6
  "author": "Jscrambler <code@jscrambler.com>",
7
7
  "repository": {
@@ -21,6 +21,7 @@
21
21
  "clean": "rm -rf ./dist",
22
22
  "build": "babel src --out-dir dist",
23
23
  "watch": "grunt watch",
24
+ "postpublish": "printf \"\\033[91m** IMPORTANT: PUBLISH Code Integrity GitHub Action **\\033[0m - https://github.com/jscrambler/code-integrity-actions/releases\n\n\"",
24
25
  "prepublish": "npm run build"
25
26
  },
26
27
  "engines": {
package/dist/cli.js DELETED
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.mergeAndParseParams = mergeAndParseParams;
7
-
8
- var _lodash = _interopRequireDefault(require("lodash.clone"));
9
-
10
- var _snakeCase = _interopRequireDefault(require("snake-case"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- // Override params file changes with any specified command line options
15
- // TODO Populate this list based on an external JSON
16
- var isBoolFlag = {
17
- booleanToAnything: true,
18
- charToTernaryOperator: false,
19
- commaOperatorUnfolding: true,
20
- controlFlowFlattening: false,
21
- deadCodeInjection: true,
22
- dotToBracketNotation: true,
23
- duplicateLiteralsRemoval: false,
24
- extendPredicates: true,
25
- functionOutlining: true,
26
- functionReorder: true,
27
- identifiersRenaming: false,
28
- numberToString: true,
29
- propertyKeysObfuscation: true,
30
- propertyKeysReordering: true,
31
- regexObfuscation: true,
32
- stringConcealing: true,
33
- stringEncoding: true,
34
- stringSplitting: false,
35
- variableGrouping: true,
36
- assertionsRemoval: false,
37
- constantFolding: true,
38
- deadCodeElimination: true,
39
- debugCodeElimination: false,
40
- whitespaceRemoval: true,
41
- selfDefending: false,
42
- browserLock: false,
43
- dateLock: false,
44
- domainLock: false,
45
- osLock: false,
46
- preserveAnnotations: true
47
- }; // Convert from command line option format to Jscrambler API format.
48
-
49
- function mergeAndParseParams(commander, params) {
50
- var finalParams = (0, _lodash.default)(params || {});
51
- Object.keys(isBoolFlag).forEach(function (name) {
52
- if (commander[name] !== undefined) {
53
- var snakeCaseName = (0, _snakeCase.default)(name);
54
-
55
- if (isBoolFlag[name] === true) {
56
- finalParams[snakeCaseName] = {
57
- status: 1
58
- };
59
- } else {
60
- finalParams[snakeCaseName] = commander[name];
61
- }
62
-
63
- if (typeof finalParams[snakeCaseName].status === 'undefined') {
64
- finalParams[snakeCaseName].status = 1;
65
- }
66
- }
67
- });
68
- return finalParams;
69
- }