You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
687 B

4 years ago
  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. };