staticRequire.js 1.6 KB

1234567891011
  1. 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports['default'] =
  2. isStaticRequire; // todo: merge with module visitor
  3. function isStaticRequire(node) {return node &&
  4. node.callee &&
  5. node.callee.type === 'Identifier' &&
  6. node.callee.name === 'require' &&
  7. node.arguments.length === 1 &&
  8. node.arguments[0].type === 'Literal' &&
  9. typeof node.arguments[0].value === 'string';
  10. }
  11. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3N0YXRpY1JlcXVpcmUuanMiXSwibmFtZXMiOlsiaXNTdGF0aWNSZXF1aXJlIiwibm9kZSIsImNhbGxlZSIsInR5cGUiLCJuYW1lIiwiYXJndW1lbnRzIiwibGVuZ3RoIiwidmFsdWUiXSwibWFwcGluZ3MiOiI7QUFDd0JBLGUsRUFEeEI7QUFDZSxTQUFTQSxlQUFULENBQXlCQyxJQUF6QixFQUErQixDQUM1QyxPQUFPQTtBQUNGQSxPQUFLQyxNQURIO0FBRUZELE9BQUtDLE1BQUwsQ0FBWUMsSUFBWixLQUFxQixZQUZuQjtBQUdGRixPQUFLQyxNQUFMLENBQVlFLElBQVosS0FBcUIsU0FIbkI7QUFJRkgsT0FBS0ksU0FBTCxDQUFlQyxNQUFmLEtBQTBCLENBSnhCO0FBS0ZMLE9BQUtJLFNBQUwsQ0FBZSxDQUFmLEVBQWtCRixJQUFsQixLQUEyQixTQUx6QjtBQU1GLFNBQU9GLEtBQUtJLFNBQUwsQ0FBZSxDQUFmLEVBQWtCRSxLQUF6QixLQUFtQyxRQU54QztBQU9EIiwiZmlsZSI6InN0YXRpY1JlcXVpcmUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0b2RvOiBtZXJnZSB3aXRoIG1vZHVsZSB2aXNpdG9yXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBpc1N0YXRpY1JlcXVpcmUobm9kZSkge1xuICByZ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