worker.js 687 B

1234567891011121314151617
  1. "use strict";
  2. var _minify = _interopRequireDefault(require("./minify"));
  3. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4. module.exports = (options, callback) => {
  5. try {
  6. // 'use strict' => this === undefined (Clean Scope)
  7. // Safer for possible security issues, albeit not critical at all here
  8. // eslint-disable-next-line no-new-func, no-param-reassign
  9. options = new Function('exports', 'require', 'module', '__filename', '__dirname', `'use strict'\nreturn ${options}`)(exports, require, module, __filename, __dirname);
  10. callback(null, (0, _minify.default)(options));
  11. } catch (errors) {
  12. callback(errors);
  13. }
  14. };