RunnableFunction.js 629 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.ParsingToolFunction = void 0;
  4. exports.isRunnableFunctionWithParse = isRunnableFunctionWithParse;
  5. function isRunnableFunctionWithParse(fn) {
  6. return typeof fn.parse === 'function';
  7. }
  8. /**
  9. * This is helper class for passing a `function` and `parse` where the `function`
  10. * argument type matches the `parse` return type.
  11. */
  12. class ParsingToolFunction {
  13. constructor(input) {
  14. this.type = 'function';
  15. this.function = input;
  16. }
  17. }
  18. exports.ParsingToolFunction = ParsingToolFunction;
  19. //# sourceMappingURL=RunnableFunction.js.map