index.js 484 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.execute = void 0;
  4. exports.default = execute;
  5. async function execute(rule) {
  6. if (!Array.isArray(rule)) {
  7. return null;
  8. }
  9. const [name, config] = rule;
  10. const fn = executable(config) ? config : async () => config;
  11. return [name, await fn()];
  12. }
  13. exports.execute = execute;
  14. function executable(config) {
  15. return typeof config === 'function';
  16. }
  17. //# sourceMappingURL=index.js.map