function File() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var pipeline = arguments[1]; (0, _classCallCheck3.default)(this, File); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.pipeline = pipeline; _this.log = new _logger2.default(_this, opts.filename || "unknown"); _this.opts = _this.initOptions(opts); _this.parserOpts = { sourceType: _this.opts.sourceType, sourceFileName: _this.opts.filename, plugins: [] }; _this.pluginVisitors = []; _this.pluginPasses = []; _this.buildPluginsForOptions(_this.opts); if (_this.opts.passPerPreset) { _this.perPresetOpts = []; _this.opts.presets.forEach(function (presetOpts) { var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts); _this.perPresetOpts.push(perPresetOpts); _this.buildPluginsForOptions(perPresetOpts); }); } _this.metadata = { usedHelpers: [], marked: [], modules: { imports: [], exports: { exported: [], specifiers: [] } } }; _this.dynamicImportTypes = {}; _this.dynamicImportIds = {}; _this.dynamicImports = []; _this.declarations = {}; _this.usedHelpers = {}; _this.path = null; _this.ast = {}; _this.code = ""; _this.shebang = ""; _this.hub = new _babelTraverse.Hub(_this); return _this; }
n/a
function OptionManager(log) { (0, _classCallCheck3.default)(this, OptionManager); this.resolvedConfigs = []; this.options = OptionManager.createBareOptions(); this.log = log; }
n/a
function Pipeline() { (0, _classCallCheck3.default)(this, Pipeline); }
n/a
function Plugin(alias) { throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6."); }
n/a
analyse = function () { [native code] }
n/a
buildExternalHelpers = function (whitelist) { var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "global"; var namespace = t.identifier("babelHelpers"); var builder = function builder(body) { return buildHelpers(body, namespace, whitelist); }; var tree = void 0; var build = { global: buildGlobal, umd: buildUmd, var: buildVar }[outputType]; if (build) { tree = build(namespace, builder); } else { throw new Error(messages.get("unsupportedOutputType", outputType)); } return (0, _babelGenerator2.default)(tree).code; }
n/a
function Logger(file, filename) { (0, _classCallCheck3.default)(this, Logger); this.filename = filename; this.file = file; }
n/a
function Plugin(plugin, key) { (0, _classCallCheck3.default)(this, Plugin); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.initialized = false; _this.raw = (0, _assign2.default)({}, plugin); _this.key = _this.take("name") || key; _this.manipulateOptions = _this.take("manipulateOptions"); _this.post = _this.take("post"); _this.pre = _this.take("pre"); _this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {}); return _this; }
n/a
function PluginPass(file, plugin) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; (0, _classCallCheck3.default)(this, PluginPass); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.plugin = plugin; _this.key = plugin.key; _this.file = file; _this.opts = options; return _this; }
n/a
function resolvePlugin(pluginName) { var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePluginNames2.default)(pluginName), dirname); }
n/a
function resolvePreset(presetName) { var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePresetNames2.default)(presetName), dirname); }
n/a
function Store() { (0, _classCallCheck3.default)(this, Store); var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this)); _this.dynamicData = {}; return _this; }
n/a
template = function (code, opts) { var stack = void 0; try { throw new Error(); } catch (error) { if (error.stack) { stack = error.stack.split("\n").slice(1).join("\n"); } } opts = (0, _assign2.default)({ allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, preserveComments: false }, opts); var _getAst = function getAst() { var ast = void 0; try { ast = babylon.parse(code, opts); ast = _babelTraverse2.default.removeProperties(ast, { preserveComments: opts.preserveComments }); _babelTraverse2.default.cheap(ast, function (node) { node[FROM_TEMPLATE] = true; }); } catch (err) { err.stack = err.stack + "from\n" + stack; throw err; } _getAst = function getAst() { return ast; }; return ast; }; return function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return useTemplate(_getAst(), args); }; }
n/a
transform = function () { [native code] }
...
var babel = require("babel-core");
import { transform } from 'babel-core';
import * as babel from 'babel-core';
```
All transformations will use your local configuration files (.babelrc or in package.json). See [options](#options) to disable it
.
## babel.transform(code: string, [options?](#options): Object)
Transforms the passed in `code`. Returning an object with the generated code,
source map, and AST.
```js
babel.transform(code, options) // => { code, map, ast }
```
...
function transformFile(filename, opts, callback) { if (typeof opts === "function") { callback = opts; opts = {}; } opts.filename = filename; _fs2.default.readFile(filename, function (err, code) { var result = void 0; if (!err) { try { result = transform(code, opts); } catch (_err) { err = _err; } } if (err) { callback(err); } else { callback(null, result); } }); }
...
```js
var result = babel.transform("code();", options);
result.code;
result.map;
result.ast;
```
## babel.transformFile(filename: string, [options?](#options): Object, callback: Function
)
Asynchronously transforms the entire contents of a file.
```js
babel.transformFile(filename, options, callback)
```
...
function transformFileSync(filename) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; opts.filename = filename; return transform(_fs2.default.readFileSync(filename, "utf8"), opts); }
...
```js
babel.transformFile("filename.js", options, function (err, result) {
result; // => { code, map, ast }
});
```
## babel.transformFileSync(filename: string, [options?](#options): Object)
Synchronous version of `babel.transformFile`. Returns the transformed contents of
the `filename`.
```js
babel.transformFileSync(filename, options) // => { code, map, ast }
```
...
transformFromAst = function () { [native code] }
...
**Example**
```js
babel.transformFileSync("filename.js", options).code;
```
## babel.transformFromAst(ast: Object, code?: string, [options?](#options): Object)
Given, an [AST](https://astexplorer.net/), transform it.
```js
const code = "if (true) return;";
const ast = babylon.parse(code, { allowReturnOutsideFunction: true });
const { code, map, ast } = babel.transformFromAst(ast, code, options);
...
function traverse(parent, opts, scope, state, parentPath) { if (!parent) return; if (!opts) opts = {}; if (!opts.noScope && !scope) { if (parent.type !== "Program" && parent.type !== "File") { throw new Error(messages.get("traverseNeedsParent", parent.type)); } } visitors.explode(opts); traverse.node(parent, opts, scope, state, parentPath); }
...
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
fnPath.scope.push({ id: id, init: init });
}
...
function NodePath(hub, parent) { (0, _classCallCheck3.default)(this, NodePath); this.parent = parent; this.hub = hub; this.contexts = []; this.data = {}; this.shouldSkip = false; this.shouldStop = false; this.removed = false; this.state = null; this.opts = null; this.skipKeys = null; this.parentPath = null; this.context = null; this.container = null; this.listKey = null; this.inList = false; this.parentKey = null; this.key = null; this.node = null; this.scope = null; this.type = null; this.typeAnnotation = null; }
n/a
function Scope(path, parentScope) { (0, _classCallCheck3.default)(this, Scope); if (parentScope && parentScope.block === path.node) { return parentScope; } var cached = getCache(path, parentScope, this); if (cached) return cached; this.uid = uid++; this.parent = parentScope; this.hub = path.hub; this.parentBlock = path.parent; this.block = path.node; this.path = path; this.labels = new _map2.default(); }
n/a
traverse.clearCache = function () { cache.clear(); }
n/a
function toKeyAlias(node) { var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key; var alias = void 0; if (node.kind === "method") { return toKeyAlias.increment() + ""; } else if (t.isIdentifier(key)) { alias = key.name; } else if (t.isStringLiteral(key)) { alias = (0, _stringify2.default)(key.value); } else { alias = (0, _stringify2.default)(t.removePropertiesDeep(t.cloneDeep(key))); } if (node.computed) { alias = "[" + alias + "]"; } if (node.static) { alias = "static:" + alias; } return alias; }
n/a
function File() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var pipeline = arguments[1]; (0, _classCallCheck3.default)(this, File); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.pipeline = pipeline; _this.log = new _logger2.default(_this, opts.filename || "unknown"); _this.opts = _this.initOptions(opts); _this.parserOpts = { sourceType: _this.opts.sourceType, sourceFileName: _this.opts.filename, plugins: [] }; _this.pluginVisitors = []; _this.pluginPasses = []; _this.buildPluginsForOptions(_this.opts); if (_this.opts.passPerPreset) { _this.perPresetOpts = []; _this.opts.presets.forEach(function (presetOpts) { var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts); _this.perPresetOpts.push(perPresetOpts); _this.buildPluginsForOptions(perPresetOpts); }); } _this.metadata = { usedHelpers: [], marked: [], modules: { imports: [], exports: { exported: [], specifiers: [] } } }; _this.dynamicImportTypes = {}; _this.dynamicImportIds = {}; _this.dynamicImports = []; _this.declarations = {}; _this.usedHelpers = {}; _this.path = null; _this.ast = {}; _this.code = ""; _this.shebang = ""; _this.hub = new _babelTraverse.Hub(_this); return _this; }
n/a
function _addAst(ast) { this.path = _babelTraverse.NodePath.get({ hub: this.hub, parentPath: null, parent: ast, container: ast, key: "program" }).setContext(); this.scope = this.path.scope; this.ast = ast; this.getMetadata(); }
n/a
function addAst(ast) { this.log.debug("Start set AST"); this._addAst(ast); this.log.debug("End set AST"); }
n/a
function addCode(code) { code = (code || "") + ""; code = this.parseInputSourceMap(code); this.code = code; }
n/a
function addHelper(name) { var declar = this.declarations[name]; if (declar) return declar; if (!this.usedHelpers[name]) { this.metadata.usedHelpers.push(name); this.usedHelpers[name] = true; } var generator = this.get("helperGenerator"); var runtime = this.get("helpersNamespace"); if (generator) { var res = generator(name); if (res) return res; } else if (runtime) { return t.memberExpression(runtime, t.identifier(name)); } var ref = (0, _babelHelpers2.default)(name); var uid = this.declarations[name] = this.scope.generateUidIdentifier(name); if (t.isFunctionExpression(ref) && !ref.id) { ref.body._compact = true; ref._generated = true; ref.id = uid; ref.type = "FunctionDeclaration"; this.path.unshiftContainer("body", ref); } else { ref._compact = true; this.scope.push({ id: uid, init: ref, unique: true }); } return uid; }
n/a
function addImport(source, imported) { var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : imported; var alias = source + ":" + imported; var id = this.dynamicImportIds[alias]; if (!id) { source = this.resolveModuleSource(source); id = this.dynamicImportIds[alias] = this.scope.generateUidIdentifier(name); var specifiers = []; if (imported === "*") { specifiers.push(t.importNamespaceSpecifier(id)); } else if (imported === "default") { specifiers.push(t.importDefaultSpecifier(id)); } else { specifiers.push(t.importSpecifier(id, t.identifier(imported))); } var declar = t.importDeclaration(specifiers, t.stringLiteral(source)); declar._blockHoist = 3; this.path.unshiftContainer("body", declar); } return id; }
n/a
function addTemplateObject(helperName, strings, raw) { var stringIds = raw.elements.map(function (string) { return string.value; }); var name = helperName + "_" + raw.elements.length + "_" + stringIds.join(","); var declar = this.declarations[name]; if (declar) return declar; var uid = this.declarations[name] = this.scope.generateUidIdentifier("templateObject"); var helperId = this.addHelper(helperName); var init = t.callExpression(helperId, [strings, raw]); init._compact = true; this.scope.push({ id: uid, init: init, _blockHoist: 1.9 }); return uid; }
n/a
function buildCodeFrameError(node, msg) { var Error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SyntaxError; var loc = node && (node.loc || node._loc); var err = new Error(msg); if (loc) { err.loc = loc.start; } else { (0, _babelTraverse2.default)(node, errorVisitor, this.scope, err); err.message += " (This is an error on an internal node. Probably an internal error"; if (err.loc) { err.message += ". Location has been estimated."; } err.message += ")"; } return err; }
n/a
function buildPluginsForOptions(opts) { if (!Array.isArray(opts.plugins)) { return; } var plugins = opts.plugins.concat(INTERNAL_PLUGINS); var currentPluginVisitors = []; var currentPluginPasses = []; for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var ref = _ref2; var plugin = ref[0], pluginOpts = ref[1]; currentPluginVisitors.push(plugin.visitor); currentPluginPasses.push(new _pluginPass2.default(this, plugin, pluginOpts)); if (plugin.manipulateOptions) { plugin.manipulateOptions(opts, this.parserOpts, this); } } this.pluginVisitors.push(currentPluginVisitors); this.pluginPasses.push(currentPluginPasses); }
n/a
function call(key, pluginPasses) { for (var _iterator3 = pluginPasses, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var pass = _ref3; var plugin = pass.plugin; var fn = plugin[key]; if (fn) fn.call(pass, this); } }
...
var Store = function (_Map) {
(0, _inherits3.default)(Store, _Map);
function Store() {
(0, _classCallCheck3.default)(this, Store);
var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this));
_this.dynamicData = {};
return _this;
}
Store.prototype.setDynamic = function setDynamic(key, fn) {
this.dynamicData[key] = fn;
...
function generate() { var opts = this.opts; var ast = this.ast; var result = { ast: ast }; if (!opts.code) return this.makeResult(result); var gen = _babelGenerator2.default; if (opts.generatorOpts.generator) { gen = opts.generatorOpts.generator; if (typeof gen === "string") { var dirname = _path2.default.dirname(this.opts.filename) || process.cwd(); var generator = (0, _resolve2.default)(gen, dirname); if (generator) { gen = require(generator).print; } else { throw new Error("Couldn't find generator " + gen + " with \"print\" method relative " + ("to directory " + dirname)); } } } this.log.debug("Generation start"); var _result = gen(ast, opts.generatorOpts ? (0, _assign2.default)(opts, opts.generatorOpts) : opts, this.code); result.code = _result.code; result.map = _result.map; this.log.debug("Generation end"); if (this.shebang) { result.code = this.shebang + "\n" + result.code; } if (result.map) { result.map = this.mergeSourceMap(result.map); } if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") { result.code += "\n" + _convertSourceMap2.default.fromObject(result.map).toComment(); } if (opts.sourceMaps === "inline") { result.map = null; } return this.makeResult(result); }
n/a
function getMetadata() { var has = false; for (var _iterator = this.ast.program.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0 , _getIterator3.default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var node = _ref; if (t.isModuleDeclaration(node)) { has = true; break; } } if (has) { this.path.traverse(metadataVisitor, this); } }
n/a
function getModuleName() { var opts = this.opts; if (!opts.moduleIds) { return null; } if (opts.moduleId != null && !opts.getModuleId) { return opts.moduleId; } var filenameRelative = opts.filenameRelative; var moduleName = ""; if (opts.moduleRoot != null) { moduleName = opts.moduleRoot + "/"; } if (!opts.filenameRelative) { return moduleName + opts.filename.replace(/^\//, ""); } if (opts.sourceRoot != null) { var sourceRootRegEx = new RegExp("^" + opts.sourceRoot + "\/?"); filenameRelative = filenameRelative.replace(sourceRootRegEx, ""); } filenameRelative = filenameRelative.replace(/\.(\w*?)$/, ""); moduleName += filenameRelative; moduleName = moduleName.replace(/\\/g, "/"); if (opts.getModuleId) { return opts.getModuleId(moduleName) || moduleName; } else { return moduleName; } }
n/a
function initOptions(opts) { opts = new _optionManager2.default(this.log, this.pipeline).init(opts); if (opts.inputSourceMap) { opts.sourceMaps = true; } if (opts.moduleId) { opts.moduleIds = true; } opts.basename = _path2.default.basename(opts.filename, _path2.default.extname(opts.filename)); opts.ignore = util.arrayify(opts.ignore, util.regexify); if (opts.only) opts.only = util.arrayify(opts.only, util.regexify); (0, _defaults2.default)(opts, { moduleRoot: opts.sourceRoot }); (0, _defaults2.default)(opts, { sourceRoot: opts.moduleRoot }); (0, _defaults2.default)(opts, { filenameRelative: opts.filename }); var basenameRelative = _path2.default.basename(opts.filenameRelative); (0, _defaults2.default)(opts, { sourceFileName: basenameRelative, sourceMapTarget: basenameRelative }); return opts; }
n/a
function makeResult(_ref4) { var code = _ref4.code, map = _ref4.map, ast = _ref4.ast, ignored = _ref4.ignored; var result = { metadata: null, options: this.opts, ignored: !!ignored, code: null, ast: null, map: map || null }; if (this.opts.code) { result.code = code; } if (this.opts.ast) { result.ast = ast; } if (this.opts.metadata) { result.metadata = this.metadata; } return result; }
n/a
function mergeSourceMap(map) { var inputMap = this.opts.inputSourceMap; if (inputMap) { var inputMapConsumer = new _sourceMap2.default.SourceMapConsumer(inputMap); var outputMapConsumer = new _sourceMap2.default.SourceMapConsumer(map); var mergedGenerator = new _sourceMap2.default.SourceMapGenerator({ file: inputMapConsumer.file, sourceRoot: inputMapConsumer.sourceRoot }); var source = outputMapConsumer.sources[0]; inputMapConsumer.eachMapping(function (mapping) { var generatedPosition = outputMapConsumer.generatedPositionFor({ line: mapping.generatedLine, column: mapping.generatedColumn, source: source }); if (generatedPosition.column != null) { mergedGenerator.addMapping({ source: mapping.source, original: mapping.source == null ? null : { line: mapping.originalLine, column: mapping.originalColumn }, generated: generatedPosition }); } }); var mergedMap = mergedGenerator.toJSON(); inputMap.mappings = mergedMap.mappings; return inputMap; } else { return map; } }
n/a
function parse(code) { var parseCode = _babylon.parse; var parserOpts = this.opts.parserOpts; if (parserOpts) { parserOpts = (0, _assign2.default)({}, this.parserOpts, parserOpts); if (parserOpts.parser) { if (typeof parserOpts.parser === "string") { var dirname = _path2.default.dirname(this.opts.filename) || process.cwd(); var parser = (0, _resolve2.default)(parserOpts.parser, dirname); if (parser) { parseCode = require(parser).parse; } else { throw new Error("Couldn't find parser " + parserOpts.parser + " with \"parse\" method " + ("relative to directory " + dirname)); } } else { parseCode = parserOpts.parser; } parserOpts.parser = { parse: function parse(source) { return (0, _babylon.parse)(source, parserOpts); } }; } } this.log.debug("Parse start"); var ast = parseCode(code, parserOpts || this.parserOpts); this.log.debug("Parse stop"); return ast; }
...
## babel.transformFromAst(ast: Object, code?: string, [options?](#options): Object)
Given, an [AST](https://astexplorer.net/), transform it.
```js
const code = "if (true) return;";
const ast = babylon.parse(code, { allowReturnOutsideFunction: true });
const { code, map, ast } = babel.transformFromAst(ast, code, options);
```
## Options
<blockquote class="babel-callout babel-callout-info">
<h4>Babel CLI</h4>
...
function parseCode() { this.parseShebang(); var ast = this.parse(this.code); this.addAst(ast); }
n/a
function parseInputSourceMap(code) { var opts = this.opts; if (opts.inputSourceMap !== false) { var inputMap = _convertSourceMap2.default.fromSource(code); if (inputMap) { opts.inputSourceMap = inputMap.toObject(); code = _convertSourceMap2.default.removeComments(code); } } return code; }
n/a
function parseShebang() { var shebangMatch = shebangRegex.exec(this.code); if (shebangMatch) { this.shebang = shebangMatch[0]; this.code = this.code.replace(shebangRegex, ""); } }
n/a
function resolveModuleSource(source) { var resolveModuleSource = this.opts.resolveModuleSource; if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename); return source; }
...
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ModuleDeclaration = exports.ModuleDeclaration = {
enter: function enter(path, file) {
var node = path.node;
if (node.source) {
node.source.value = file.resolveModuleSource(node.source.value);
}
}
};
var ImportDeclaration = exports.ImportDeclaration = {
exit: function exit(path, file) {
var node = path.node;
...
function shouldIgnore() { var opts = this.opts; return util.shouldIgnore(opts.filename, opts.ignore, opts.only); }
n/a
function transform() { for (var i = 0; i < this.pluginPasses.length; i++) { var pluginPasses = this.pluginPasses[i]; this.call("pre", pluginPasses); this.log.debug("Start transform traverse"); var visitor = _babelTraverse2.default.visitors.merge(this.pluginVisitors[i], pluginPasses, this.opts.wrapPluginVisitorMethod ); (0, _babelTraverse2.default)(this.ast, visitor, this.scope); this.log.debug("End transform traverse"); this.call("post", pluginPasses); } return this.generate(); }
...
var babel = require("babel-core");
import { transform } from 'babel-core';
import * as babel from 'babel-core';
```
All transformations will use your local configuration files (.babelrc or in package.json). See [options](#options) to disable it
.
## babel.transform(code: string, [options?](#options): Object)
Transforms the passed in `code`. Returning an object with the generated code,
source map, and AST.
```js
babel.transform(code, options) // => { code, map, ast }
```
...
function wrap(code, callback) { code = code + ""; try { if (this.shouldIgnore()) { return this.makeResult({ code: code, ignored: true }); } else { return callback(); } } catch (err) { if (err._babel) { throw err; } else { err._babel = true; } var message = err.message = this.opts.filename + ": " + err.message; var loc = err.loc; if (loc) { err.codeFrame = (0, _babelCodeFrame2.default)(code, loc.line, loc.column + 1, this.opts); message += "\n" + err.codeFrame; } if (process.browser) { err.message = message; } if (err.stack) { var newStack = err.stack.replace(err.message, message); err.stack = newStack; } throw err; } }
n/a
function OptionManager(log) { (0, _classCallCheck3.default)(this, OptionManager); this.resolvedConfigs = []; this.options = OptionManager.createBareOptions(); this.log = log; }
n/a
function createBareOptions() { var opts = {}; for (var _key in _config3.default) { var opt = _config3.default[_key]; opts[_key] = (0, _clone2.default)(opt.default); } return opts; }
n/a
function memoisePluginContainer(fn, loc, i, alias) { for (var _iterator = OptionManager.memoisedPlugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var cache = _ref; if (cache.container === fn) return cache.plugin; } var obj = void 0; if (typeof fn === "function") { obj = fn(context); } else { obj = fn; } if ((typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) === "object") { var _plugin = new _plugin3.default(obj, alias); OptionManager.memoisedPlugins.push({ container: fn, plugin: _plugin }); return _plugin; } else { throw new TypeError(messages.get("pluginNotObject", loc, i, typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)( obj)) + loc + i); } }
n/a
function normalisePlugin(plugin, loc, i, alias) { plugin = plugin.__esModule ? plugin.default : plugin; if (!(plugin instanceof _plugin3.default)) { if (typeof plugin === "function" || (typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)) === "object ") { plugin = OptionManager.memoisePluginContainer(plugin, loc, i, alias); } else { throw new TypeError(messages.get("pluginNotFunction", loc, i, typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default )(plugin))); } } plugin.init(loc, i); return plugin; }
...
};
};
Plugin.prototype.maybeInherit = function maybeInherit(loc) {
var inherits = this.take("inherits");
if (!inherits) return;
inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits"
;);
this.manipulateOptions = this.chain(inherits, "manipulateOptions");
this.post = this.chain(inherits, "post");
this.pre = this.chain(inherits, "pre");
this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]);
};
...
function normalisePlugins(loc, dirname, plugins) { return plugins.map(function (val, i) { var plugin = void 0, options = void 0; if (!val) { throw new TypeError("Falsy value found in plugins"); } if (Array.isArray(val)) { plugin = val[0]; options = val[1]; } else { plugin = val; } var alias = typeof plugin === "string" ? plugin : loc + "$" + i; if (typeof plugin === "string") { var pluginLoc = (0, _resolvePlugin2.default)(plugin, dirname); if (pluginLoc) { plugin = require(pluginLoc); } else { throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname)); } } plugin = OptionManager.normalisePlugin(plugin, loc, i, alias); return [plugin, options]; }); }
n/a
function init() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; for (var _iterator2 = (0, _buildConfigChain2.default)(opts, this.log), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var _config = _ref3; this.mergeOptions(_config); } this.normaliseOptions(opts); return this.options; }
n/a
function mergeOptions(_ref2) { var _this = this; var rawOpts = _ref2.options, extendingOpts = _ref2.extending, alias = _ref2.alias, loc = _ref2.loc, dirname = _ref2.dirname; alias = alias || "foreign"; if (!rawOpts) return; if ((typeof rawOpts === "undefined" ? "undefined" : (0, _typeof3.default)(rawOpts)) !== "object" || Array.isArray(rawOpts)) { this.log.error("Invalid options type for " + alias, TypeError); } var opts = (0, _cloneDeepWith2.default)(rawOpts, function (val) { if (val instanceof _plugin3.default) { return val; } }); dirname = dirname || process.cwd(); loc = loc || alias; for (var _key2 in opts) { var option = _config3.default[_key2]; if (!option && this.log) { if (_removed2.default[_key2]) { this.log.error("Using removed Babel 5 option: " + alias + "." + _key2 + " - " + _removed2.default[_key2].message, ReferenceError ); } else { var unknownOptErr = "Unknown option: " + alias + "." + _key2 + ". Check out http://babeljs.io/docs/usage/options/ for more information about options."; var presetConfigErr = "A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options."; this.log.error(unknownOptErr + "\n\n" + presetConfigErr, ReferenceError); } } } (0, _index.normaliseOptions)(opts); if (opts.plugins) { opts.plugins = OptionManager.normalisePlugins(loc, dirname, opts.plugins); } if (opts.presets) { if (opts.passPerPreset) { opts.presets = this.resolvePresets(opts.presets, dirname, function (preset, presetLoc) { _this.mergeOptions({ options: preset, extending: preset, alias: presetLoc, loc: presetLoc, dirname: dirname }); }); } else { this.mergePresets(opts.presets, dirname); delete opts.presets; } } if (rawOpts === extendingOpts) { (0, _assign2.default)(extendingOpts, opts); } else { (0, _merge2.default)(extendingOpts || this.options, opts); } }
n/a
function mergePresets(presets, dirname) { var _this2 = this; this.resolvePresets(presets, dirname, function (presetOpts, presetLoc) { _this2.mergeOptions({ options: presetOpts, alias: presetLoc, loc: presetLoc, dirname: _path2.default.dirname(presetLoc || "") }); }); }
n/a
function normaliseOptions() { var opts = this.options; for (var _key3 in _config3.default) { var option = _config3.default[_key3]; var val = opts[_key3]; if (!val && option.optional) continue; if (option.alias) { opts[option.alias] = opts[option.alias] || val; } else { opts[_key3] = val; } } }
n/a
function resolvePresets(presets, dirname, onResolve) { return presets.map(function (val) { var options = void 0; if (Array.isArray(val)) { if (val.length > 2) { throw new Error("Unexpected extra options " + (0, _stringify2.default)(val.slice(2)) + " passed to preset."); } var _val = val; val = _val[0]; options = _val[1]; } var presetLoc = void 0; try { if (typeof val === "string") { presetLoc = (0, _resolvePreset2.default)(val, dirname); if (!presetLoc) { throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2. default)(dirname)); } val = require(presetLoc); } if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.__esModule) { if (val.default) { val = val.default; } else { var _val2 = val, __esModule = _val2.__esModule, rest = (0, _objectWithoutProperties3.default)(_val2, ["__esModule"]); val = rest; } } if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.buildPreset) val = val.buildPreset ; if (typeof val !== "function" && options !== undefined) { throw new Error("Options " + (0, _stringify2.default)(options) + " passed to " + (presetLoc || "a preset") + " which does not accept options."); } if (typeof val === "function") val = val(context, options, { dirname: dirname }); if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) !== "object") { throw new Error("Unsupported preset format: " + val + "."); } onResolve && onResolve(val, presetLoc); } catch (e) { if (presetLoc) { e.message += " (While processing preset: " + (0, _stringify2.default)(presetLoc) + ")"; } throw e; } return val; }); }
n/a
function Pipeline() { (0, _classCallCheck3.default)(this, Pipeline); }
n/a
function analyse(code) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var visitor = arguments[2]; opts.code = false; if (visitor) { opts.plugins = opts.plugins || []; opts.plugins.push(new _plugin2.default({ visitor: visitor })); } return this.transform(code, opts).metadata; }
n/a
function lint(code) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; opts.code = false; opts.mode = "lint"; return this.transform(code, opts); }
n/a
function pretransform(code, opts) { var file = new _file2.default(opts, this); return file.wrap(code, function () { file.addCode(code); file.parseCode(code); return file; }); }
n/a
function transform(code, opts) { var file = new _file2.default(opts, this); return file.wrap(code, function () { file.addCode(code); file.parseCode(code); return file.transform(); }); }
...
var babel = require("babel-core");
import { transform } from 'babel-core';
import * as babel from 'babel-core';
```
All transformations will use your local configuration files (.babelrc or in package.json). See [options](#options) to disable it
.
## babel.transform(code: string, [options?](#options): Object)
Transforms the passed in `code`. Returning an object with the generated code,
source map, and AST.
```js
babel.transform(code, options) // => { code, map, ast }
```
...
function transformFromAst(ast, code, opts) { ast = (0, _normalizeAst2.default)(ast); var file = new _file2.default(opts, this); return file.wrap(code, function () { file.addCode(code); file.addAst(ast); return file.transform(); }); }
...
**Example**
```js
babel.transformFileSync("filename.js", options).code;
```
## babel.transformFromAst(ast: Object, code?: string, [options?](#options): Object)
Given, an [AST](https://astexplorer.net/), transform it.
```js
const code = "if (true) return;";
const ast = babylon.parse(code, { allowReturnOutsideFunction: true });
const { code, map, ast } = babel.transformFromAst(ast, code, options);
...
function File() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var pipeline = arguments[1]; (0, _classCallCheck3.default)(this, File); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.pipeline = pipeline; _this.log = new _logger2.default(_this, opts.filename || "unknown"); _this.opts = _this.initOptions(opts); _this.parserOpts = { sourceType: _this.opts.sourceType, sourceFileName: _this.opts.filename, plugins: [] }; _this.pluginVisitors = []; _this.pluginPasses = []; _this.buildPluginsForOptions(_this.opts); if (_this.opts.passPerPreset) { _this.perPresetOpts = []; _this.opts.presets.forEach(function (presetOpts) { var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts); _this.perPresetOpts.push(perPresetOpts); _this.buildPluginsForOptions(perPresetOpts); }); } _this.metadata = { usedHelpers: [], marked: [], modules: { imports: [], exports: { exported: [], specifiers: [] } } }; _this.dynamicImportTypes = {}; _this.dynamicImportIds = {}; _this.dynamicImports = []; _this.declarations = {}; _this.usedHelpers = {}; _this.path = null; _this.ast = {}; _this.code = ""; _this.shebang = ""; _this.hub = new _babelTraverse.Hub(_this); return _this; }
n/a
function OptionManager(log) { (0, _classCallCheck3.default)(this, OptionManager); this.resolvedConfigs = []; this.options = OptionManager.createBareOptions(); this.log = log; }
n/a
function Pipeline() { (0, _classCallCheck3.default)(this, Pipeline); }
n/a
function Plugin(alias) { throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6."); }
n/a
analyse = function () { [native code] }
n/a
buildExternalHelpers = function (whitelist) { var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "global"; var namespace = t.identifier("babelHelpers"); var builder = function builder(body) { return buildHelpers(body, namespace, whitelist); }; var tree = void 0; var build = { global: buildGlobal, umd: buildUmd, var: buildVar }[outputType]; if (build) { tree = build(namespace, builder); } else { throw new Error(messages.get("unsupportedOutputType", outputType)); } return (0, _babelGenerator2.default)(tree).code; }
n/a
function load(url, callback) { var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var hold = arguments[3]; opts.filename = opts.filename || url; var xhr = global.ActiveXObject ? new global.ActiveXObject("Microsoft.XMLHTTP") : new global.XMLHttpRequest(); xhr.open("GET", url, true); if ("overrideMimeType" in xhr) xhr.overrideMimeType("text/plain"); xhr.onreadystatechange = function () { if (xhr.readyState !== 4) return; var status = xhr.status; if (status === 0 || status === 200) { var param = [xhr.responseText, opts]; if (!hold) run(param); if (callback) callback(param); } else { throw new Error("Could not load " + url); } }; xhr.send(null); }
n/a
function run(code) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return new Function((0, _node.transform)(code, opts).code)(); }
n/a
template = function (code, opts) { var stack = void 0; try { throw new Error(); } catch (error) { if (error.stack) { stack = error.stack.split("\n").slice(1).join("\n"); } } opts = (0, _assign2.default)({ allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, preserveComments: false }, opts); var _getAst = function getAst() { var ast = void 0; try { ast = babylon.parse(code, opts); ast = _babelTraverse2.default.removeProperties(ast, { preserveComments: opts.preserveComments }); _babelTraverse2.default.cheap(ast, function (node) { node[FROM_TEMPLATE] = true; }); } catch (err) { err.stack = err.stack + "from\n" + stack; throw err; } _getAst = function getAst() { return ast; }; return ast; }; return function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return useTemplate(_getAst(), args); }; }
n/a
transform = function () { [native code] }
...
var babel = require("babel-core");
import { transform } from 'babel-core';
import * as babel from 'babel-core';
```
All transformations will use your local configuration files (.babelrc or in package.json). See [options](#options) to disable it
.
## babel.transform(code: string, [options?](#options): Object)
Transforms the passed in `code`. Returning an object with the generated code,
source map, and AST.
```js
babel.transform(code, options) // => { code, map, ast }
```
...
function transformFile(filename, opts, callback) { if (typeof opts === "function") { callback = opts; opts = {}; } opts.filename = filename; _fs2.default.readFile(filename, function (err, code) { var result = void 0; if (!err) { try { result = transform(code, opts); } catch (_err) { err = _err; } } if (err) { callback(err); } else { callback(null, result); } }); }
...
```js
var result = babel.transform("code();", options);
result.code;
result.map;
result.ast;
```
## babel.transformFile(filename: string, [options?](#options): Object, callback: Function
)
Asynchronously transforms the entire contents of a file.
```js
babel.transformFile(filename, options, callback)
```
...
function transformFileSync(filename) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; opts.filename = filename; return transform(_fs2.default.readFileSync(filename, "utf8"), opts); }
...
```js
babel.transformFile("filename.js", options, function (err, result) {
result; // => { code, map, ast }
});
```
## babel.transformFileSync(filename: string, [options?](#options): Object)
Synchronous version of `babel.transformFile`. Returns the transformed contents of
the `filename`.
```js
babel.transformFileSync(filename, options) // => { code, map, ast }
```
...
transformFromAst = function () { [native code] }
...
**Example**
```js
babel.transformFileSync("filename.js", options).code;
```
## babel.transformFromAst(ast: Object, code?: string, [options?](#options): Object)
Given, an [AST](https://astexplorer.net/), transform it.
```js
const code = "if (true) return;";
const ast = babylon.parse(code, { allowReturnOutsideFunction: true });
const { code, map, ast } = babel.transformFromAst(ast, code, options);
...
function traverse(parent, opts, scope, state, parentPath) { if (!parent) return; if (!opts) opts = {}; if (!opts.noScope && !scope) { if (parent.type !== "Program" && parent.type !== "File") { throw new Error(messages.get("traverseNeedsParent", parent.type)); } } visitors.explode(opts); traverse.node(parent, opts, scope, state, parentPath); }
...
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
fnPath.scope.push({ id: id, init: init });
}
...
function File() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var pipeline = arguments[1]; (0, _classCallCheck3.default)(this, File); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.pipeline = pipeline; _this.log = new _logger2.default(_this, opts.filename || "unknown"); _this.opts = _this.initOptions(opts); _this.parserOpts = { sourceType: _this.opts.sourceType, sourceFileName: _this.opts.filename, plugins: [] }; _this.pluginVisitors = []; _this.pluginPasses = []; _this.buildPluginsForOptions(_this.opts); if (_this.opts.passPerPreset) { _this.perPresetOpts = []; _this.opts.presets.forEach(function (presetOpts) { var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts); _this.perPresetOpts.push(perPresetOpts); _this.buildPluginsForOptions(perPresetOpts); }); } _this.metadata = { usedHelpers: [], marked: [], modules: { imports: [], exports: { exported: [], specifiers: [] } } }; _this.dynamicImportTypes = {}; _this.dynamicImportIds = {}; _this.dynamicImports = []; _this.declarations = {}; _this.usedHelpers = {}; _this.path = null; _this.ast = {}; _this.code = ""; _this.shebang = ""; _this.hub = new _babelTraverse.Hub(_this); return _this; }
n/a
function OptionManager(log) { (0, _classCallCheck3.default)(this, OptionManager); this.resolvedConfigs = []; this.options = OptionManager.createBareOptions(); this.log = log; }
n/a
function Pipeline() { (0, _classCallCheck3.default)(this, Pipeline); }
n/a
function Plugin(alias) { throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6."); }
n/a
analyse = function () { [native code] }
n/a
buildExternalHelpers = function (whitelist) { var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "global"; var namespace = t.identifier("babelHelpers"); var builder = function builder(body) { return buildHelpers(body, namespace, whitelist); }; var tree = void 0; var build = { global: buildGlobal, umd: buildUmd, var: buildVar }[outputType]; if (build) { tree = build(namespace, builder); } else { throw new Error(messages.get("unsupportedOutputType", outputType)); } return (0, _babelGenerator2.default)(tree).code; }
n/a
function resolvePlugin(pluginName) { var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePluginNames2.default)(pluginName), dirname); }
n/a
function resolvePreset(presetName) { var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePresetNames2.default)(presetName), dirname); }
n/a
template = function (code, opts) { var stack = void 0; try { throw new Error(); } catch (error) { if (error.stack) { stack = error.stack.split("\n").slice(1).join("\n"); } } opts = (0, _assign2.default)({ allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, preserveComments: false }, opts); var _getAst = function getAst() { var ast = void 0; try { ast = babylon.parse(code, opts); ast = _babelTraverse2.default.removeProperties(ast, { preserveComments: opts.preserveComments }); _babelTraverse2.default.cheap(ast, function (node) { node[FROM_TEMPLATE] = true; }); } catch (err) { err.stack = err.stack + "from\n" + stack; throw err; } _getAst = function getAst() { return ast; }; return ast; }; return function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return useTemplate(_getAst(), args); }; }
n/a
transform = function () { [native code] }
...
var babel = require("babel-core");
import { transform } from 'babel-core';
import * as babel from 'babel-core';
```
All transformations will use your local configuration files (.babelrc or in package.json). See [options](#options) to disable it
.
## babel.transform(code: string, [options?](#options): Object)
Transforms the passed in `code`. Returning an object with the generated code,
source map, and AST.
```js
babel.transform(code, options) // => { code, map, ast }
```
...
function transformFile(filename, opts, callback) { if (typeof opts === "function") { callback = opts; opts = {}; } opts.filename = filename; _fs2.default.readFile(filename, function (err, code) { var result = void 0; if (!err) { try { result = transform(code, opts); } catch (_err) { err = _err; } } if (err) { callback(err); } else { callback(null, result); } }); }
...
```js
var result = babel.transform("code();", options);
result.code;
result.map;
result.ast;
```
## babel.transformFile(filename: string, [options?](#options): Object, callback: Function
)
Asynchronously transforms the entire contents of a file.
```js
babel.transformFile(filename, options, callback)
```
...
function transformFileSync(filename) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; opts.filename = filename; return transform(_fs2.default.readFileSync(filename, "utf8"), opts); }
...
```js
babel.transformFile("filename.js", options, function (err, result) {
result; // => { code, map, ast }
});
```
## babel.transformFileSync(filename: string, [options?](#options): Object)
Synchronous version of `babel.transformFile`. Returns the transformed contents of
the `filename`.
```js
babel.transformFileSync(filename, options) // => { code, map, ast }
```
...
transformFromAst = function () { [native code] }
...
**Example**
```js
babel.transformFileSync("filename.js", options).code;
```
## babel.transformFromAst(ast: Object, code?: string, [options?](#options): Object)
Given, an [AST](https://astexplorer.net/), transform it.
```js
const code = "if (true) return;";
const ast = babylon.parse(code, { allowReturnOutsideFunction: true });
const { code, map, ast } = babel.transformFromAst(ast, code, options);
...
function traverse(parent, opts, scope, state, parentPath) { if (!parent) return; if (!opts) opts = {}; if (!opts.noScope && !scope) { if (parent.type !== "Program" && parent.type !== "File") { throw new Error(messages.get("traverseNeedsParent", parent.type)); } } visitors.explode(opts); traverse.node(parent, opts, scope, state, parentPath); }
...
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
fnPath.scope.push({ id: id, init: init });
}
...
function Logger(file, filename) { (0, _classCallCheck3.default)(this, Logger); this.filename = filename; this.file = file; }
n/a
function _buildMessage(msg) { var parts = "[BABEL] " + this.filename; if (msg) parts += ": " + msg; return parts; }
...
Logger.prototype._buildMessage = function _buildMessage(msg) {
var parts = "[BABEL] " + this.filename;
if (msg) parts += ": " + msg;
return parts;
};
Logger.prototype.warn = function warn(msg) {
console.warn(this._buildMessage(msg));
};
Logger.prototype.error = function error(msg) {
var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error;
throw new Constructor(this._buildMessage(msg));
};
...
function debug(msg) { if (generalDebug.enabled) generalDebug(this._buildMessage(msg)); }
...
};
Logger.prototype.debug = function debug(msg) {
if (generalDebug.enabled) generalDebug(this._buildMessage(msg));
};
Logger.prototype.deopt = function deopt(node, msg) {
this.debug(msg);
};
return Logger;
}();
exports.default = Logger;
module.exports = exports["default"];
...
function deopt(node, msg) { this.debug(msg); }
n/a
function deprecate(msg) { if (this.file.opts && this.file.opts.suppressDeprecationMessages) return; msg = this._buildMessage(msg); if (seenDeprecatedMessages.indexOf(msg) >= 0) return; seenDeprecatedMessages.push(msg); console.error(msg); }
n/a
function error(msg) { var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error; throw new Constructor(this._buildMessage(msg)); }
...
msg = this._buildMessage(msg);
if (seenDeprecatedMessages.indexOf(msg) >= 0) return;
seenDeprecatedMessages.push(msg);
console.error(msg);
};
Logger.prototype.verbose = function verbose(msg) {
if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg));
};
Logger.prototype.debug = function debug(msg) {
...
function verbose(msg) { if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg)); }
n/a
function warn(msg) { console.warn(this._buildMessage(msg)); }
...
Logger.prototype._buildMessage = function _buildMessage(msg) {
var parts = "[BABEL] " + this.filename;
if (msg) parts += ": " + msg;
return parts;
};
Logger.prototype.warn = function warn(msg) {
console.warn(this._buildMessage(msg));
};
Logger.prototype.error = function error(msg) {
var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error;
throw new Constructor(this._buildMessage(msg));
};
...
function get(key) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var msg = MESSAGES[key]; if (!msg) throw new ReferenceError("Unknown message " + (0, _stringify2.default)(key)); args = parseArgs(args); return msg.replace(/\$(\d+)/g, function (str, i) { return args[i - 1]; }); }
...
Plugin.prototype.init = function init(loc, i) {
if (this.initialized) return;
this.initialized = true;
this.maybeInherit(loc);
for (var key in this.raw) {
throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
}
};
Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2
: (0, _getIterator3.default)(_iterator2);;) {
var _ref2;
...
function parseArgs(args) { return args.map(function (val) { if (val != null && val.inspect) { return val.inspect(); } else { try { return (0, _stringify2.default)(val) || val + ""; } catch (e) { return util.inspect(val); } } }); }
n/a
function ExportDeclaration(path, file) { var node = path.node; var source = node.source ? node.source.value : null; var exports = file.metadata.modules.exports; var declar = path.get("declaration"); if (declar.isStatement()) { var bindings = declar.getBindingIdentifiers(); for (var name in bindings) { exports.exported.push(name); exports.specifiers.push({ kind: "local", local: name, exported: path.isExportDefaultDeclaration() ? "default" : name }); } } if (path.isExportNamedDeclaration() && node.specifiers) { for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : ( 0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var specifier = _ref2; var exported = specifier.exported.name; exports.exported.push(exported); if (t.isExportDefaultSpecifier(specifier)) { exports.specifiers.push({ kind: "external", local: exported, exported: exported, source: source }); } if (t.isExportNamespaceSpecifier(specifier)) { exports.specifiers.push({ kind: "external-namespace", exported: exported, source: source }); } var local = specifier.local; if (!local) continue; if (source) { exports.specifiers.push({ kind: "external", local: local.name, exported: exported, source: source }); } if (!source) { exports.specifiers.push({ kind: "local", local: local.name, exported: exported }); } } } if (path.isExportAllDeclaration()) { exports.specifiers.push({ kind: "external-all", source: source }); } }
n/a
function Scope(path) { path.skip(); }
n/a
function Plugin(plugin, key) { (0, _classCallCheck3.default)(this, Plugin); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.initialized = false; _this.raw = (0, _assign2.default)({}, plugin); _this.key = _this.take("name") || key; _this.manipulateOptions = _this.take("manipulateOptions"); _this.post = _this.take("post"); _this.pre = _this.take("pre"); _this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {}); return _this; }
n/a
function chain(target, key) { if (!target[key]) return this[key]; if (!this[key]) return target[key]; var fns = [target[key], this[key]]; return function () { var val = void 0; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3. default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var fn = _ref; if (fn) { var ret = fn.apply(this, args); if (ret != null) val = ret; } } return val; }; }
...
Plugin.prototype.maybeInherit = function maybeInherit(loc) {
var inherits = this.take("inherits");
if (!inherits) return;
inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits");
this.manipulateOptions = this.chain(inherits, "manipulateOptions");
this.post = this.chain(inherits, "post");
this.pre = this.chain(inherits, "pre");
this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]);
};
Plugin.prototype.init = function init(loc, i) {
if (this.initialized) return;
...
function init(loc, i) { if (this.initialized) return; this.initialized = true; this.maybeInherit(loc); for (var key in this.raw) { throw new Error(messages.get("pluginInvalidProperty", loc, i, key)); } }
n/a
function maybeInherit(loc) { var inherits = this.take("inherits"); if (!inherits) return; inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits"); this.manipulateOptions = this.chain(inherits, "manipulateOptions"); this.post = this.chain(inherits, "post"); this.pre = this.chain(inherits, "pre"); this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]); }
...
this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]);
};
Plugin.prototype.init = function init(loc, i) {
if (this.initialized) return;
this.initialized = true;
this.maybeInherit(loc);
for (var key in this.raw) {
throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
}
};
Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
...
function normaliseVisitor(visitor) { for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var key = _ref2; if (visitor[key]) { throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target individual nodes."); } } _babelTraverse2.default.explode(visitor); return visitor; }
...
_this.initialized = false;
_this.raw = (0, _assign2.default)({}, plugin);
_this.key = _this.take("name") || key;
_this.manipulateOptions = _this.take("manipulateOptions");
_this.post = _this.take("post");
_this.pre = _this.take("pre");
_this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor
")) || {});
return _this;
}
Plugin.prototype.take = function take(key) {
var val = this.raw[key];
delete this.raw[key];
return val;
...
function take(key) { var val = this.raw[key]; delete this.raw[key]; return val; }
...
function Plugin(plugin, key) {
(0, _classCallCheck3.default)(this, Plugin);
var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
_this.initialized = false;
_this.raw = (0, _assign2.default)({}, plugin);
_this.key = _this.take("name") || key;
_this.manipulateOptions = _this.take("manipulateOptions");
_this.post = _this.take("post");
_this.pre = _this.take("pre");
_this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {});
return _this;
}
...
function PluginPass(file, plugin) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; (0, _classCallCheck3.default)(this, PluginPass); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.plugin = plugin; _this.key = plugin.key; _this.file = file; _this.opts = options; return _this; }
n/a
function addHelper() { var _file; return (_file = this.file).addHelper.apply(_file, arguments); }
n/a
function addImport() { var _file2; return (_file2 = this.file).addImport.apply(_file2, arguments); }
n/a
function buildCodeFrameError() { var _file4; return (_file4 = this.file).buildCodeFrameError.apply(_file4, arguments); }
n/a
function getModuleName() { var _file3; return (_file3 = this.file).getModuleName.apply(_file3, arguments); }
n/a
function Store() { (0, _classCallCheck3.default)(this, Store); var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this)); _this.dynamicData = {}; return _this; }
n/a
function get(key) { if (this.has(key)) { return _Map.prototype.get.call(this, key); } else { if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) { var val = this.dynamicData[key](); this.set(key, val); return val; } } }
...
Plugin.prototype.init = function init(loc, i) {
if (this.initialized) return;
this.initialized = true;
this.maybeInherit(loc);
for (var key in this.raw) {
throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
}
};
Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2
: (0, _getIterator3.default)(_iterator2);;) {
var _ref2;
...
function setDynamic(key, fn) { this.dynamicData[key] = fn; }
n/a
function traverse(parent, opts, scope, state, parentPath) { if (!parent) return; if (!opts) opts = {}; if (!opts.noScope && !scope) { if (parent.type !== "Program" && parent.type !== "File") { throw new Error(messages.get("traverseNeedsParent", parent.type)); } } visitors.explode(opts); traverse.node(parent, opts, scope, state, parentPath); }
...
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
fnPath.scope.push({ id: id, init: init });
}
...
function Hub(file, options) { (0, _classCallCheck3.default)(this, Hub); this.file = file; this.options = options; }
n/a
function NodePath(hub, parent) { (0, _classCallCheck3.default)(this, NodePath); this.parent = parent; this.hub = hub; this.contexts = []; this.data = {}; this.shouldSkip = false; this.shouldStop = false; this.removed = false; this.state = null; this.opts = null; this.skipKeys = null; this.parentPath = null; this.context = null; this.container = null; this.listKey = null; this.inList = false; this.parentKey = null; this.key = null; this.node = null; this.scope = null; this.type = null; this.typeAnnotation = null; }
n/a
function Scope(path, parentScope) { (0, _classCallCheck3.default)(this, Scope); if (parentScope && parentScope.block === path.node) { return parentScope; } var cached = getCache(path, parentScope, this); if (cached) return cached; this.uid = uid++; this.parent = parentScope; this.hub = path.hub; this.parentBlock = path.parent; this.block = path.node; this.path = path; this.labels = new _map2.default(); }
n/a
cheap = function (node, enter) { return t.traverseFast(node, enter); }
n/a
clearCache = function () { cache.clear(); }
n/a
clearNode = function (node, opts) { t.removeProperties(node, opts); cache.path.delete(node); }
n/a
copyCache = function (source, destination) { if (cache.path.has(source)) { cache.path.set(destination, cache.path.get(source)); } }
n/a
function explode(visitor) { if (visitor._exploded) return visitor; visitor._exploded = true; for (var nodeType in visitor) { if (shouldIgnoreKey(nodeType)) continue; var parts = nodeType.split("|"); if (parts.length === 1) continue; var fns = visitor[nodeType]; delete visitor[nodeType]; for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var part = _ref; visitor[part] = fns; } } verify(visitor); delete visitor.__esModule; ensureEntranceObjects(visitor); ensureCallbackArrays(visitor); for (var _iterator2 = (0, _keys2.default)(visitor), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _nodeType3 = _ref2; if (shouldIgnoreKey(_nodeType3)) continue; var wrapper = virtualTypes[_nodeType3]; if (!wrapper) continue; var _fns2 = visitor[_nodeType3]; for (var type in _fns2) { _fns2[type] = wrapCheck(wrapper, _fns2[type]); } delete visitor[_nodeType3]; if (wrapper.types) { for (var _iterator4 = wrapper.types, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : ( 0, _getIterator3.default)(_iterator4);;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var _type = _ref4; if (visitor[_type]) { mergePair(visitor[_type], _fns2); } else { visitor[_type] = _fns2; } } } else { mergePair(visitor, _fns2); } } for (var _nodeType in visitor) { if (shouldIgnoreKey(_nodeType)) continue; var _fns = visitor[_nodeType]; var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType]; var deprecratedKey = t.DEPRECATED_KEYS[_nodeType]; if (deprecratedKey) { console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey); aliases = [deprecratedKey]; } if (!aliases) continue; delete visitor[_nodeType]; for (var _iterator3 = aliases, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3 .default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var alias = _ref3; var existing = visitor[alias]; if (existing) { mergePair(existing, _fns); } else { visitor[alias] = (0, _clone2.default)(_fns); } } } for (var _nodeType2 in visitor) { if (shouldIgnoreKey(_nodeType2)) continue; ensureCallbackArrays(visitor[_nodeType2]); } return visitor; }
...
var key = _ref2;
if (visitor[key]) {
throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target
individual nodes.");
}
}
_babelTraverse2.default.explode(visitor);
return visitor;
};
return Plugin;
}(_store2.default);
exports.default = Plugin;
...
hasType = function (tree, scope, type, blacklistTypes) { if ((0, _includes2.default)(blacklistTypes, tree.type)) return false; if (tree.type === type) return true; var state = { has: false, type: type }; traverse(tree, { blacklist: blacklistTypes, enter: hasBlacklistedType }, scope, state); return state.has; }
n/a
node = function (node, opts, scope, state, parentPath, skipKeys) { var keys = t.VISITOR_KEYS[node.type]; if (!keys) return; var context = new _context2.default(scope, opts, state, parentPath); for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default )(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var key = _ref; if (skipKeys && skipKeys[key]) continue; if (context.visit(node, key)) return; } }
n/a
removeProperties = function (tree, opts) { t.traverseFast(tree, traverse.clearNode, opts); return tree; }
n/a
function verify(visitor) { if (visitor._verified) return; if (typeof visitor === "function") { throw new Error(messages.get("traverseVerifyRootFunction")); } for (var nodeType in visitor) { if (nodeType === "enter" || nodeType === "exit") { validateVisitorMethods(nodeType, visitor[nodeType]); } if (shouldIgnoreKey(nodeType)) continue; if (t.TYPES.indexOf(nodeType) < 0) { throw new Error(messages.get("traverseVerifyNodeType", nodeType)); } var visitors = visitor[nodeType]; if ((typeof visitors === "undefined" ? "undefined" : (0, _typeof3.default)(visitors)) === "object") { for (var visitorKey in visitors) { if (visitorKey === "enter" || visitorKey === "exit") { validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]); } else { throw new Error(messages.get("traverseVerifyVisitorProperty", nodeType, visitorKey)); } } } } visitor._verified = true; }
n/a
function NodePath(hub, parent) { (0, _classCallCheck3.default)(this, NodePath); this.parent = parent; this.hub = hub; this.contexts = []; this.data = {}; this.shouldSkip = false; this.shouldStop = false; this.removed = false; this.state = null; this.opts = null; this.skipKeys = null; this.parentPath = null; this.context = null; this.container = null; this.listKey = null; this.inList = false; this.parentKey = null; this.key = null; this.node = null; this.scope = null; this.type = null; this.typeAnnotation = null; }
n/a
function get(_ref) { var hub = _ref.hub, parentPath = _ref.parentPath, parent = _ref.parent, container = _ref.container, listKey = _ref.listKey, key = _ref.key; if (!hub && parentPath) { hub = parentPath.hub; } (0, _invariant2.default)(parent, "To get a node path the parent needs to exist"); var targetNode = container[key]; var paths = _cache.path.get(parent) || []; if (!_cache.path.has(parent)) { _cache.path.set(parent, paths); } var path = void 0; for (var i = 0; i < paths.length; i++) { var pathCheck = paths[i]; if (pathCheck.node === targetNode) { path = pathCheck; break; } } if (!path) { path = new NodePath(hub, parent); paths.push(path); } path.setup(parentPath, container, listKey, key); return path; }
...
Plugin.prototype.init = function init(loc, i) {
if (this.initialized) return;
this.initialized = true;
this.maybeInherit(loc);
for (var key in this.raw) {
throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
}
};
Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2
: (0, _getIterator3.default)(_iterator2);;) {
var _ref2;
...
function _assertUnremoved() { if (this.removed) { throw this.buildCodeFrameError("NodePath has been removed so is read-only."); } }
n/a
function _call(fns) { if (!fns) return false; for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default )(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var fn = _ref; if (!fn) continue; var node = this.node; if (!node) return true; var ret = fn.call(this.state, this, this.state); if (ret) throw new Error("Unexpected return value from visitor method " + fn); if (this.node !== node) return true; if (this.shouldStop || this.shouldSkip || this.removed) return true; } return false; }
n/a
function _callRemovalHooks() { for (var _iterator = _removalHooks.hooks, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var fn = _ref; if (fn(this, this.parentPath)) return true; } }
n/a
function _containerInsert(from, nodes) { this.updateSiblingKeys(from, nodes.length); var paths = []; for (var i = 0; i < nodes.length; i++) { var to = from + i; var node = nodes[i]; this.container.splice(to, 0, node); if (this.context) { var path = this.context.create(this.parent, this.container, to, this.listKey); if (this.context.queue) path.pushContext(this.context); paths.push(path); } else { paths.push(_index2.default.get({ parentPath: this.parentPath, parent: this.parent, container: this.container, listKey: this.listKey, key: to })); } } var contexts = this._getQueueContexts(); for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3. default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var _path = _ref; _path.setScope(); _path.debug(function () { return "Inserted."; }); for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var context = _ref2; context.maybeQueue(_path, true); } } return paths; }
n/a
function _containerInsertAfter(nodes) { return this._containerInsert(this.key + 1, nodes); }
n/a
function _containerInsertBefore(nodes) { return this._containerInsert(this.key, nodes); }
n/a
function _getKey(key, context) { var _this = this; var node = this.node; var container = node[key]; if (Array.isArray(container)) { return container.map(function (_, i) { return _index2.default.get({ listKey: key, parentPath: _this, parent: node, container: container, key: i }).setContext(context); }); } else { return _index2.default.get({ parentPath: this, parent: node, container: node, key: key }).setContext(context); } }
n/a
function _getPattern(parts, context) { var path = this; for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3. default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var part = _ref; if (part === ".") { path = path.parentPath; } else { if (Array.isArray(path)) { path = path[part]; } else { path = path.get(part, context); } } } return path; }
n/a
function _getQueueContexts() { var path = this; var contexts = this.contexts; while (!contexts.length) { path = path.parentPath; contexts = path.contexts; } return contexts; }
n/a
function _getTypeAnnotation() { var node = this.node; if (!node) { if (this.key === "init" && this.parentPath.isVariableDeclarator()) { var declar = this.parentPath.parentPath; var declarParent = declar.parentPath; if (declar.key === "left" && declarParent.isForInStatement()) { return t.stringTypeAnnotation(); } if (declar.key === "left" && declarParent.isForOfStatement()) { return t.anyTypeAnnotation(); } return t.voidTypeAnnotation(); } else { return; } } if (node.typeAnnotation) { return node.typeAnnotation; } var inferer = inferers[node.type]; if (inferer) { return inferer.call(this, node); } inferer = inferers[this.parentPath.type]; if (inferer && inferer.validParent) { return this.parentPath.getTypeAnnotation(); } }
n/a
function _guessExecutionStatusRelativeTo(target) { var targetFuncParent = target.scope.getFunctionParent(); var selfFuncParent = this.scope.getFunctionParent(); if (targetFuncParent.node !== selfFuncParent.node) { var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent); if (status) { return status; } else { target = targetFuncParent.path; } } var targetPaths = target.getAncestry(); if (targetPaths.indexOf(this) >= 0) return "after"; var selfPaths = this.getAncestry(); var commonPath = void 0; var targetIndex = void 0; var selfIndex = void 0; for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) { var selfPath = selfPaths[selfIndex]; targetIndex = targetPaths.indexOf(selfPath); if (targetIndex >= 0) { commonPath = selfPath; break; } } if (!commonPath) { return "before"; } var targetRelationship = targetPaths[targetIndex - 1]; var selfRelationship = selfPaths[selfIndex - 1]; if (!targetRelationship || !selfRelationship) { return "before"; } if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) { return targetRelationship.key > selfRelationship.key ? "before" : "after"; } var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key); var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key); return targetKeyPosition > selfKeyPosition ? "before" : "after"; }
n/a
function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) { var targetFuncPath = targetFuncParent.path; if (!targetFuncPath.isFunctionDeclaration()) return; var binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name); if (!binding.references) return "before"; var referencePaths = binding.referencePaths; for (var _iterator = referencePaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var path = _ref; if (path.key !== "callee" || !path.parentPath.isCallExpression()) { return; } } var allStatus = void 0; for (var _iterator2 = referencePaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0 , _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _path = _ref2; var childOfFunction = !!_path.find(function (path) { return path.node === targetFuncPath.node; }); if (childOfFunction) continue; var status = this._guessExecutionStatusRelativeTo(_path); if (allStatus) { if (allStatus !== status) return; } else { allStatus = status; } } return allStatus; }
n/a
function _markRemoved() { this.shouldSkip = true; this.removed = true; this.node = null; }
n/a
function _maybePopFromStatements(nodes) { var last = nodes[nodes.length - 1]; var isIdentifier = t.isIdentifier(last) || t.isExpressionStatement(last) && t.isIdentifier(last.expression); if (isIdentifier && !this.isCompletionRecord()) { nodes.pop(); } }
n/a
function _remove() { if (Array.isArray(this.container)) { this.container.splice(this.key, 1); this.updateSiblingKeys(this.key, -1); } else { this._replaceWith(null); } }
n/a
function _replaceWith(node) { if (!this.container) { throw new ReferenceError("Container is falsy"); } if (this.inList) { t.validate(this.parent, this.key, [node]); } else { t.validate(this.parent, this.key, node); } this.debug(function () { return "Replace with " + (node && node.type); }); this.node = this.container[this.key] = node; }
n/a
function _resolve(dangerous, resolved) { if (resolved && resolved.indexOf(this) >= 0) return; resolved = resolved || []; resolved.push(this); if (this.isVariableDeclarator()) { if (this.get("id").isIdentifier()) { return this.get("init").resolve(dangerous, resolved); } else {} } else if (this.isReferencedIdentifier()) { var binding = this.scope.getBinding(this.node.name); if (!binding) return; if (!binding.constant) return; if (binding.kind === "module") return; if (binding.path !== this) { var ret = binding.path.resolve(dangerous, resolved); if (this.find(function (parent) { return parent.node === ret.node; })) return; return ret; } } else if (this.isTypeCastExpression()) { return this.get("expression").resolve(dangerous, resolved); } else if (dangerous && this.isMemberExpression()) { var targetKey = this.toComputedKey(); if (!t.isLiteral(targetKey)) return; var targetName = targetKey.value; var target = this.get("object").resolve(dangerous, resolved); if (target.isObjectExpression()) { var props = target.get("properties"); for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3 .default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var prop = _ref3; if (!prop.isProperty()) continue; var key = prop.get("key"); var match = prop.isnt("computed") && key.isIdentifier({ name: targetName }); match = match || key.isLiteral({ value: targetName }); if (match) return prop.get("value").resolve(dangerous, resolved); } } else if (target.isArrayExpression() && !isNaN(+targetName)) { var elems = target.get("elements"); var elem = elems[targetName]; if (elem) return elem.resolve(dangerous, resolved); } } }
n/a
function _resyncKey() { if (!this.container) return; if (this.node === this.container[this.key]) return; if (Array.isArray(this.container)) { for (var i = 0; i < this.container.length; i++) { if (this.container[i] === this.node) { return this.setKey(i); } } } else { for (var key in this.container) { if (this.container[key] === this.node) { return this.setKey(key); } } } this.key = null; }
n/a
function _resyncList() { if (!this.parent || !this.inList) return; var newContainer = this.parent[this.listKey]; if (this.container === newContainer) return; this.container = newContainer || null; }
n/a
function _resyncParent() { if (this.parentPath) { this.parent = this.parentPath.node; } }
n/a
function _resyncRemoved() { if (this.key == null || !this.container || this.container[this.key] !== this.node) { this._markRemoved(); } }
n/a
function _verifyNodeList(nodes) { if (!nodes) { return []; } if (nodes.constructor !== Array) { nodes = [nodes]; } for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; var msg = void 0; if (!node) { msg = "has falsy node"; } else if ((typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node)) !== "object") { msg = "contains a non-object node"; } else if (!node.type) { msg = "without a type"; } else if (node instanceof _index2.default) { msg = "has a NodePath when it expected a raw object"; } if (msg) { var type = Array.isArray(node) ? "array" : typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node); throw new Error("Node list " + msg + " with the index of " + i + " and type of " + type); } } return nodes; }
n/a
function addComment(type, content, line) { this.addComments(type, [{ type: line ? "CommentLine" : "CommentBlock", value: content }]); }
n/a
function addComments(type, comments) { if (!comments) return; var node = this.node; if (!node) return; var key = type + "Comments"; if (node[key]) { node[key] = node[key].concat(comments); } else { node[key] = comments; } }
n/a
function arrowFunctionToShadowed() { if (!this.isArrowFunctionExpression()) return; this.ensureBlock(); var node = this.node; node.expression = false; node.type = "FunctionExpression"; node.shadow = node.shadow || true; }
n/a
assertAnyTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertArrayExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertArrayPattern = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertArrayTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertArrowFunctionExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertAssignmentExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertAssignmentPattern = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertAwaitExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBinary = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBinaryExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBindExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBlock = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBlockParent = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBlockStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBooleanLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBooleanLiteralTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBooleanTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertBreakStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertCallExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertCatchClause = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertClass = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertClassBody = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertClassDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertClassExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertClassImplements = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertClassMethod = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertClassProperty = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertCompletionStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertConditional = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertConditionalExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertContinueStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDebuggerStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDeclareClass = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDeclareFunction = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDeclareInterface = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDeclareModule = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDeclareModuleExports = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDeclareTypeAlias = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDeclareVariable = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDecorator = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDirective = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDirectiveLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDoExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertDoWhileStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertEmptyStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertEmptyTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExistentialTypeParam = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExportAllDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExportDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExportDefaultDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExportDefaultSpecifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExportNamedDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExportNamespaceSpecifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExportSpecifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExpressionStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertExpressionWrapper = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFile = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFlow = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFlowBaseAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFlowDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFor = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertForAwaitStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertForInStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertForOfStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertForStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertForXStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFunction = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFunctionDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFunctionExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFunctionParent = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFunctionTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertFunctionTypeParam = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertGenericTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertIdentifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertIfStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertImmutable = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertImport = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertImportDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertImportDefaultSpecifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertImportNamespaceSpecifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertImportSpecifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertInterfaceDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertInterfaceExtends = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertIntersectionTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSX = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXAttribute = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXClosingElement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXElement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXEmptyExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXExpressionContainer = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXIdentifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXMemberExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXNamespacedName = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXOpeningElement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXSpreadAttribute = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXSpreadChild = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertJSXText = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertLVal = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertLabeledStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertLogicalExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertLoop = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertMemberExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertMetaProperty = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertMethod = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertMixedTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertModuleDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertModuleSpecifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNewExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNoop = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNullLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNullLiteralTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNullableTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNumberLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNumberTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNumericLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertNumericLiteralTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectMember = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectMethod = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectPattern = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectProperty = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectTypeCallProperty = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectTypeIndexer = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertObjectTypeProperty = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertParenthesizedExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertPattern = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertProgram = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertProperty = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertPureish = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertQualifiedTypeIdentifier = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertRegExpLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertRegexLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertRestElement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertRestProperty = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertReturnStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertScopable = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertSequenceExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertSpreadElement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertSpreadProperty = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertStringLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertStringLiteralTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertStringTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertSuper = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertSwitchCase = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertSwitchStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTaggedTemplateExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTemplateElement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTemplateLiteral = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTerminatorless = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertThisExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertThisTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertThrowStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTryStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTupleTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTypeAlias = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTypeCastExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTypeParameter = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTypeParameterDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTypeParameterInstantiation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertTypeofTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertUnaryExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertUnaryLike = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertUnionTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertUpdateExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertUserWhitespacable = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertVariableDeclaration = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertVariableDeclarator = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertVoidTypeAnnotation = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertWhile = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertWhileStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertWithStatement = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
assertYieldExpression = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }
n/a
function baseTypeStrictlyMatches(right) { var left = this.getTypeAnnotation(); right = right.getTypeAnnotation(); if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) { return right.type === left.type; } }
n/a
function buildCodeFrameError(msg) { var Error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SyntaxError; return this.hub.file.buildCodeFrameError(this.node, msg, Error); }
n/a
function call(key) { var opts = this.opts; this.debug(function () { return key; }); if (this.node) { if (this._call(opts[key])) return true; } if (this.node) { return this._call(opts[this.node.type] && opts[this.node.type][key]); } return false; }
...
var Store = function (_Map) {
(0, _inherits3.default)(Store, _Map);
function Store() {
(0, _classCallCheck3.default)(this, Store);
var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this));
_this.dynamicData = {};
return _this;
}
Store.prototype.setDynamic = function setDynamic(key, fn) {
this.dynamicData[key] = fn;
...
function canHaveVariableDeclarationOrExpression() { return (this.key === "init" || this.key === "left") && this.parentPath.isFor(); }
n/a
function canSwapBetweenExpressionAndStatement(replacement) { if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) { return false; } if (this.isExpression()) { return t.isBlockStatement(replacement); } else if (this.isBlockStatement()) { return t.isExpression(replacement); } return false; }
n/a
function couldBeBaseType(name) { var type = this.getTypeAnnotation(); if (t.isAnyTypeAnnotation(type)) return true; if (t.isUnionTypeAnnotation(type)) { for (var _iterator = type.types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var type2 = _ref; if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) { return true; } } return false; } else { return _isBaseType(name, type, true); } }
n/a
function debug(buildMessage) { if (!_debug.enabled) return; _debug(this.getPathLocation() + " " + this.type + ": " + buildMessage()); }
...
};
Logger.prototype.debug = function debug(msg) {
if (generalDebug.enabled) generalDebug(this._buildMessage(msg));
};
Logger.prototype.deopt = function deopt(node, msg) {
this.debug(msg);
};
return Logger;
}();
exports.default = Logger;
module.exports = exports["default"];
...
function ensureBlock() { return t.ensureBlock(this.node); }
n/a
function equals(key, value) { return this.node[key] === value; }
n/a
function evaluate() { var confident = true; var deoptPath = void 0; var seen = new _map2.default(); function deopt(path) { if (!confident) return; deoptPath = path; confident = false; } var value = evaluate(this); if (!confident) value = undefined; return { confident: confident, deopt: deoptPath, value: value }; function evaluate(path) { var node = path.node; if (seen.has(node)) { var existing = seen.get(node); if (existing.resolved) { return existing.value; } else { deopt(path); return; } } else { var item = { resolved: false }; seen.set(node, item); var val = _evaluate(path); if (confident) { item.resolved = true; item.value = val; } return val; } } function _evaluate(path) { if (!confident) return; var node = path.node; if (path.isSequenceExpression()) { var exprs = path.get("expressions"); return evaluate(exprs[exprs.length - 1]); } if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) { return node.value; } if (path.isNullLiteral()) { return null; } if (path.isTemplateLiteral()) { var str = ""; var i = 0; var _exprs = path.get("expressions"); for (var _iterator = node.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var elem = _ref; if (!confident) break; str += elem.value.cooked; var expr = _exprs[i++]; if (expr) str += String(evaluate(expr)); } if (!confident) return; return str; } if (path.isConditionalExpression()) { var testResult = evaluate(path.get("test")); if (!confident) return; if (testResult) { return evaluate(path.get("consequent")); } else { return evaluate(path.get("alternate")); } } if (path.isExpressionWrapper()) { return evaluate(path.get("expression")); } if (path.isMemberExpression() && !path.parentPath.isCallExpression({ callee: node })) { var property = path.get("property"); var object = path.get("object"); if (object.isLiteral() && property.isIdentifier()) { var _value = object.node.value; var type = typeof _value === "undefined" ? "undefined" : (0, _typeof3.default)(_value); if (type === "number" || type === "string") { return _value[property.node.name]; } } } if (path.isReferencedIdentifier()) { var binding = path.scope.getBinding(node.name); if (binding && binding.constantViolations.length > 0) { return deopt(binding.path); } if (binding && path.node.start < binding.path.node.end) { return deopt(binding.path); } if (binding && binding.hasValue) { return binding.value; } else { if (node.name === "undefined") { return binding ? deopt(binding.path) : undefined; } else if (node.name === "Infinity") { return binding ? deopt(binding.path) : Infinity; } else if (node.name === "NaN") { return binding ? deopt(binding.path) : NaN; } var resolved = path.resolve(); if (resolved === path) { return deopt(path); } else { return evaluate(resolved); } } } if (path.isUnaryExpression({ prefix: true })) { if (node.operator === "void") { return undefined; } var argument = path.get("argument"); if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) { return "function"; } var arg = evaluate(argument); if (!confident) r ...
n/a
function evaluateTruthy() { var res = this.evaluate(); if (res.confident) return !!res.value; }
n/a
function find(callback) { var path = this; do { if (callback(path)) return path; } while (path = path.parentPath); return null; }
...
if (!shouldShadow(path, shadowPath)) return;
var shadowFunction = path.node._shadowedFunctionLiteral;
var currentFunction = void 0;
var passedShadowFunction = false;
var fnPath = path.find(function (innerPath) {
if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value") {
return true;
}
if (path === innerPath) return false;
if (innerPath.isProgram() || innerPath.isFunction()) {
currentFunction = currentFunction || innerPath;
}
...
function findParent(callback) { var path = this; while (path = path.parentPath) { if (callback(path)) return path; } return null; }
...
return false;
}
return false;
});
if (shadowFunction && fnPath.isProgram() && !shadowFunction.isProgram()) {
fnPath = path.findParent(function (p) {
return p.isProgram() || p.isFunction();
});
}
if (fnPath === currentFunction) return;
if (!passedShadowFunction) return;
...
function get(key, context) { if (context === true) context = this.context; var parts = key.split("."); if (parts.length === 1) { return this._getKey(key, context); } else { return this._getPattern(parts, context); } }
...
Plugin.prototype.init = function init(loc, i) {
if (this.initialized) return;
this.initialized = true;
this.maybeInherit(loc);
for (var key in this.raw) {
throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
}
};
Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2
: (0, _getIterator3.default)(_iterator2);;) {
var _ref2;
...
function getAllNextSiblings() { var _key = this.key; var sibling = this.getSibling(++_key); var siblings = []; while (sibling.node) { siblings.push(sibling); sibling = this.getSibling(++_key); } return siblings; }
n/a
function getAllPrevSiblings() { var _key = this.key; var sibling = this.getSibling(--_key); var siblings = []; while (sibling.node) { siblings.push(sibling); sibling = this.getSibling(--_key); } return siblings; }
n/a
function getAncestry() { var path = this; var paths = []; do { paths.push(path); } while (path = path.parentPath); return paths; }
n/a
function getBindingIdentifierPaths() { var duplicates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var outerOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var path = this; var search = [].concat(path); var ids = (0, _create2.default)(null); while (search.length) { var id = search.shift(); if (!id) continue; if (!id.node) continue; var keys = t.getBindingIdentifiers.keys[id.node.type]; if (id.isIdentifier()) { if (duplicates) { var _ids = ids[id.node.name] = ids[id.node.name] || []; _ids.push(id); } else { ids[id.node.name] = id; } continue; } if (id.isExportDeclaration()) { var declaration = id.get("declaration"); if (declaration.isDeclaration()) { search.push(declaration); } continue; } if (outerOnly) { if (id.isFunctionDeclaration()) { search.push(id.get("id")); continue; } if (id.isFunctionExpression()) { continue; } } if (keys) { for (var i = 0; i < keys.length; i++) { var key = keys[i]; var child = id.get(key); if (Array.isArray(child) || child.node) { search = search.concat(child); } } } } return ids; }
n/a
function getBindingIdentifiers(duplicates) { return t.getBindingIdentifiers(this.node, duplicates); }
...
var source = node.source ? node.source.value : null;
var exports = file.metadata.modules.exports;
var declar = path.get("declaration");
if (declar.isStatement()) {
var bindings = declar.getBindingIdentifiers();
for (var name in bindings) {
exports.exported.push(name);
exports.specifiers.push({
kind: "local",
local: name,
exported: path.isExportDefaultDeclaration() ? "default" : name
...
function getCompletionRecords() { var paths = []; var add = function add(path) { if (path) paths = paths.concat(path.getCompletionRecords()); }; if (this.isIfStatement()) { add(this.get("consequent")); add(this.get("alternate")); } else if (this.isDoExpression() || this.isFor() || this.isWhile()) { add(this.get("body")); } else if (this.isProgram() || this.isBlockStatement()) { add(this.get("body").pop()); } else if (this.isFunction()) { return this.get("body").getCompletionRecords(); } else if (this.isTryStatement()) { add(this.get("block")); add(this.get("handler")); add(this.get("finalizer")); } else { paths.push(this); } return paths; }
n/a
function getData(key, def) { var val = this.data[key]; if (!val && def) val = this.data[key] = def; return val; }
...
});
}
if (fnPath === currentFunction) return;
if (!passedShadowFunction) return;
var cached = fnPath.getData(key);
if (cached) return path.replaceWith(cached);
var id = path.scope.generateUidIdentifier(key);
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
...
function getDeepestCommonAncestorFrom(paths, filter) { var _this = this; if (!paths.length) { return this; } if (paths.length === 1) { return paths[0]; } var minDepth = Infinity; var lastCommonIndex = void 0, lastCommon = void 0; var ancestries = paths.map(function (path) { var ancestry = []; do { ancestry.unshift(path); } while ((path = path.parentPath) && path !== _this); if (ancestry.length < minDepth) { minDepth = ancestry.length; } return ancestry; }); var first = ancestries[0]; depthLoop: for (var i = 0; i < minDepth; i++) { var shouldMatch = first[i]; for (var _iterator2 = ancestries, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var ancestry = _ref2; if (ancestry[i] !== shouldMatch) { break depthLoop; } } lastCommonIndex = i; lastCommon = shouldMatch; } if (lastCommon) { if (filter) { return filter(lastCommon, lastCommonIndex, ancestries); } else { return lastCommon; } } else { throw new Error("Couldn't find intersection"); } }
n/a
function getEarliestCommonAncestorFrom(paths) { return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) { var earliest = void 0; var keys = t.VISITOR_KEYS[deepest.type]; for (var _iterator = ancestries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var ancestry = _ref; var path = ancestry[i + 1]; if (!earliest) { earliest = path; continue; } if (path.listKey && earliest.listKey === path.listKey) { if (path.key < earliest.key) { earliest = path; continue; } } var earliestKeyIndex = keys.indexOf(earliest.parentKey); var currentKeyIndex = keys.indexOf(path.parentKey); if (earliestKeyIndex > currentKeyIndex) { earliest = path; } } return earliest; }); }
n/a
function getFunctionParent() { return this.findParent(function (path) { return path.isFunction() || path.isProgram(); }); }
n/a
function getNextSibling() { return this.getSibling(this.key + 1); }
n/a
function getOpposite() { if (this.key === "left") { return this.getSibling("right"); } else if (this.key === "right") { return this.getSibling("left"); } }
n/a
function getOuterBindingIdentifierPaths(duplicates) { return this.getBindingIdentifierPaths(duplicates, true); }
n/a
function getOuterBindingIdentifiers(duplicates) { return t.getOuterBindingIdentifiers(this.node, duplicates); }
n/a
function getPathLocation() { var parts = []; var path = this; do { var key = path.key; if (path.inList) key = path.listKey + "[" + key + "]"; parts.unshift(key); } while (path = path.parentPath); return parts.join("."); }
n/a
function getPrevSibling() { return this.getSibling(this.key - 1); }
n/a
function getScope(scope) { var ourScope = scope; if (this.isScope()) { ourScope = new _scope2.default(this, scope); } return ourScope; }
n/a
function getSibling(key) { return _index2.default.get({ parentPath: this.parentPath, parent: this.parent, container: this.container, listKey: this.listKey, key: key }); }
n/a
function getSource() { var node = this.node; if (node.end) { return this.hub.file.code.slice(node.start, node.end); } else { return ""; } }
n/a
function getStatementParent() { var path = this; do { if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) { break; } else { path = path.parentPath; } } while (path); if (path && (path.isProgram() || path.isFile())) { throw new Error("File/Program node, we can't possibly find a statement parent to this"); } return path; }
n/a
function getTypeAnnotation() { if (this.typeAnnotation) return this.typeAnnotation; var type = this._getTypeAnnotation() || t.anyTypeAnnotation(); if (t.isTypeAnnotation(type)) type = type.typeAnnotation; return this.typeAnnotation = type; }
n/a
function has(key) { var val = this.node && this.node[key]; if (val && Array.isArray(val)) { return !!val.length; } else { return !!val; } }
...
}
Store.prototype.setDynamic = function setDynamic(key, fn) {
this.dynamicData[key] = fn;
};
Store.prototype.get = function get(key) {
if (this.has(key)) {
return _Map.prototype.get.call(this, key);
} else {
if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) {
var val = this.dynamicData[key]();
this.set(key, val);
return val;
}
...
function hoist() { var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.scope; var hoister = new _hoister2.default(this, scope); return hoister.run(); }
n/a
function inShadow(key) { var parentFn = this.isFunction() ? this : this.findParent(function (p) { return p.isFunction(); }); if (!parentFn) return; if (parentFn.isFunctionExpression() || parentFn.isFunctionDeclaration()) { var shadow = parentFn.node.shadow; if (shadow && (!key || shadow[key] !== false)) { return parentFn; } } else if (parentFn.isArrowFunctionExpression()) { return parentFn; } return null; }
...
return true;
} else {
return shadowPath;
}
}
function remap(path, key) {
var shadowPath = path.inShadow(key);
if (!shouldShadow(path, shadowPath)) return;
var shadowFunction = path.node._shadowedFunctionLiteral;
var currentFunction = void 0;
var passedShadowFunction = false;
...
function inType() { var path = this; while (path) { for (var _iterator3 = arguments, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3 .default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var type = _ref3; if (path.node.type === type) return true; } path = path.parentPath; } return false; }
n/a
function insertAfter(nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { return this.parentPath.insertAfter(nodes); } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") { if (this.node) { var temp = this.scope.generateDeclaredUidIdentifier(); nodes.unshift(t.expressionStatement(t.assignmentExpression("=", temp, this.node))); nodes.push(t.expressionStatement(temp)); } this.replaceExpressionWithStatements(nodes); } else { this._maybePopFromStatements(nodes); if (Array.isArray(this.container)) { return this._containerInsertAfter(nodes); } else if (this.isStatementOrBlock()) { if (this.node) nodes.unshift(this.node); this._replaceWith(t.blockStatement(nodes)); } else { throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here ?"); } } return [this]; }
n/a
function insertBefore(nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { return this.parentPath.insertBefore(nodes); } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") { if (this.node) nodes.push(this.node); this.replaceExpressionWithStatements(nodes); } else { this._maybePopFromStatements(nodes); if (Array.isArray(this.container)) { return this._containerInsertBefore(nodes); } else if (this.isStatementOrBlock()) { if (this.node) nodes.push(this.node); this._replaceWith(t.blockStatement(nodes)); } else { throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here ?"); } } return [this]; }
n/a
function has(key) { var val = this.node && this.node[key]; if (val && Array.isArray(val)) { return !!val.length; } else { return !!val; } }
...
}
}
}
});
function shouldShadow(path, shadowPath) {
if (path.is("_forceShadow")) {
return true;
} else {
return shadowPath;
}
}
function remap(path, key) {
...
function isAncestor(maybeDescendant) { return maybeDescendant.isDescendant(this); }
n/a
isAnyTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isArrayExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isArrayPattern = function (opts) { return t[typeKey](this.node, opts); }
n/a
isArrayTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isArrowFunctionExpression = function (opts) { return t[typeKey](this.node, opts); }
...
currentFunction = currentFunction || innerPath;
}
if (innerPath.isProgram()) {
passedShadowFunction = true;
return true;
} else if (innerPath.isFunction() && !innerPath.isArrowFunctionExpression()) {
if (shadowFunction) {
if (innerPath === shadowFunction || innerPath.node === shadowFunction.node) return true;
} else {
if (!innerPath.is("shadow")) return true;
}
passedShadowFunction = true;
...
isAssignmentExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isAssignmentPattern = function (opts) { return t[typeKey](this.node, opts); }
n/a
isAwaitExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
function isBaseType(baseName, soft) { return _isBaseType(baseName, this.getTypeAnnotation(), soft); }
n/a
isBinary = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBinaryExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBindExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBindingIdentifier = function (opts) { return virtualType.checkPath(this, opts); }
n/a
function isBlacklisted() { var blacklist = this.opts.blacklist; return blacklist && blacklist.indexOf(this.node.type) > -1; }
n/a
isBlock = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBlockParent = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBlockScoped = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isBlockStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBooleanLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBooleanLiteralTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBooleanTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isBreakStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isCallExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isCatchClause = function (opts) { return t[typeKey](this.node, opts); }
n/a
isClass = function (opts) { return t[typeKey](this.node, opts); }
...
if (cached) return path.replaceWith(cached);
var id = path.scope.generateUidIdentifier(key);
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
...
isClassBody = function (opts) { return t[typeKey](this.node, opts); }
n/a
isClassDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isClassExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isClassImplements = function (opts) { return t[typeKey](this.node, opts); }
n/a
isClassMethod = function (opts) { return t[typeKey](this.node, opts); }
n/a
isClassProperty = function (opts) { return t[typeKey](this.node, opts); }
...
var shadowFunction = path.node._shadowedFunctionLiteral;
var currentFunction = void 0;
var passedShadowFunction = false;
var fnPath = path.find(function (innerPath) {
if (innerPath.parentPath && innerPath.parentPath.isClassProperty() &
x26; innerPath.key === "value") {
return true;
}
if (path === innerPath) return false;
if (innerPath.isProgram() || innerPath.isFunction()) {
currentFunction = currentFunction || innerPath;
}
...
function isCompletionRecord(allowInsideFunction) { var path = this; var first = true; do { var container = path.container; if (path.isFunction() && !first) { return !!allowInsideFunction; } first = false; if (Array.isArray(container) && path.key !== container.length - 1) { return false; } } while ((path = path.parentPath) && !path.isProgram()); return true; }
n/a
isCompletionStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isConditional = function (opts) { return t[typeKey](this.node, opts); }
n/a
isConditionalExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isContinueStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDebuggerStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDeclareClass = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDeclareFunction = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDeclareInterface = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDeclareModule = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDeclareModuleExports = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDeclareTypeAlias = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDeclareVariable = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDecorator = function (opts) { return t[typeKey](this.node, opts); }
n/a
function isDescendant(maybeAncestor) { return !!this.findParent(function (parent) { return parent === maybeAncestor; }); }
n/a
isDirective = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDirectiveLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDoExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isDoWhileStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isEmptyStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isEmptyTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isExistentialTypeParam = function (opts) { return t[typeKey](this.node, opts); }
n/a
isExportAllDeclaration = function (opts) { return t[typeKey](this.node, opts); }
...
local: local.name,
exported: exported
});
}
}
}
if (path.isExportAllDeclaration()) {
exports.specifiers.push({
kind: "external-all",
source: source
});
}
}
...
isExportDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isExportDefaultDeclaration = function (opts) { return t[typeKey](this.node, opts); }
...
var bindings = declar.getBindingIdentifiers();
for (var name in bindings) {
exports.exported.push(name);
exports.specifiers.push({
kind: "local",
local: name,
exported: path.isExportDefaultDeclaration() ? "default" : name
});
}
}
if (path.isExportNamedDeclaration() && node.specifiers) {
for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (
0, _getIterator3.default)(_iterator2);;) {
var _ref2;
...
isExportDefaultSpecifier = function (opts) { return t[typeKey](this.node, opts); }
...
}
var specifier = _ref2;
var exported = specifier.exported.name;
exports.exported.push(exported);
if (t.isExportDefaultSpecifier(specifier)) {
exports.specifiers.push({
kind: "external",
local: exported,
exported: exported,
source: source
});
}
...
isExportNamedDeclaration = function (opts) { return t[typeKey](this.node, opts); }
...
kind: "local",
local: name,
exported: path.isExportDefaultDeclaration() ? "default" : name
});
}
}
if (path.isExportNamedDeclaration() && node.specifiers) {
for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (
0, _getIterator3.default)(_iterator2);;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
} else {
...
isExportNamespaceSpecifier = function (opts) { return t[typeKey](this.node, opts); }
...
kind: "external",
local: exported,
exported: exported,
source: source
});
}
if (t.isExportNamespaceSpecifier(specifier)) {
exports.specifiers.push({
kind: "external-namespace",
exported: exported,
source: source
});
}
...
isExportSpecifier = function (opts) { return t[typeKey](this.node, opts); }
n/a
isExpression = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isExpressionStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isExpressionWrapper = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFile = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFlow = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isFlowBaseAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFlowDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFor = function (opts) { return t[typeKey](this.node, opts); }
n/a
isForAwaitStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isForInStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isForOfStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isForStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isForXStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFunction = function (opts) { return t[typeKey](this.node, opts); }
...
var passedShadowFunction = false;
var fnPath = path.find(function (innerPath) {
if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value"
;) {
return true;
}
if (path === innerPath) return false;
if (innerPath.isProgram() || innerPath.isFunction()) {
currentFunction = currentFunction || innerPath;
}
if (innerPath.isProgram()) {
passedShadowFunction = true;
return true;
...
isFunctionDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFunctionExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFunctionParent = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFunctionTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isFunctionTypeParam = function (opts) { return t[typeKey](this.node, opts); }
n/a
isGenerated = function (opts) { return virtualType.checkPath(this, opts); }
n/a
function isGenericType(genericName) { var type = this.getTypeAnnotation(); return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, { name: genericName }); }
n/a
isGenericTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isIdentifier = function (opts) { return t[typeKey](this.node, opts); }
n/a
isIfStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isImmutable = function (opts) { return t[typeKey](this.node, opts); }
n/a
isImport = function (opts) { return t[typeKey](this.node, opts); }
n/a
isImportDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isImportDefaultSpecifier = function (opts) { return t[typeKey](this.node, opts); }
...
_ref = _i.value;
}
var specifier = _ref;
var local = specifier.node.local.name;
if (specifier.isImportDefaultSpecifier()) {
imported.push("default");
specifiers.push({
kind: "named",
imported: "default",
local: local
});
}
...
isImportNamespaceSpecifier = function (opts) { return t[typeKey](this.node, opts); }
...
specifiers.push({
kind: "named",
imported: importedName,
local: local
});
}
if (specifier.isImportNamespaceSpecifier()) {
imported.push("*");
specifiers.push({
kind: "namespace",
local: local
});
}
}
...
isImportSpecifier = function (opts) { return t[typeKey](this.node, opts); }
...
specifiers.push({
kind: "named",
imported: "default",
local: local
});
}
if (specifier.isImportSpecifier()) {
var importedName = specifier.node.imported.name;
imported.push(importedName);
specifiers.push({
kind: "named",
imported: importedName,
local: local
});
...
isInterfaceDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isInterfaceExtends = function (opts) { return t[typeKey](this.node, opts); }
n/a
isIntersectionTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSX = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXAttribute = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXClosingElement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXElement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXEmptyExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXExpressionContainer = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXIdentifier = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXMemberExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXNamespacedName = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXOpeningElement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXSpreadAttribute = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXSpreadChild = function (opts) { return t[typeKey](this.node, opts); }
n/a
isJSXText = function (opts) { return t[typeKey](this.node, opts); }
n/a
isLVal = function (opts) { return t[typeKey](this.node, opts); }
n/a
isLabeledStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isLogicalExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isLoop = function (opts) { return t[typeKey](this.node, opts); }
n/a
isMemberExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isMetaProperty = function (opts) { return t[typeKey](this.node, opts); }
n/a
isMethod = function (opts) { return t[typeKey](this.node, opts); }
...
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor
" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
...
isMixedTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isModuleDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isModuleSpecifier = function (opts) { return t[typeKey](this.node, opts); }
n/a
isNewExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
function isNodeType(type) { return t.isType(this.type, type); }
n/a
isNoop = function (opts) { return t[typeKey](this.node, opts); }
n/a
isNullLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isNullLiteralTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isNullableTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isNumberLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isNumberTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isNumericLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isNumericLiteralTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectMember = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectMethod = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectPattern = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectProperty = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectTypeCallProperty = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectTypeIndexer = function (opts) { return t[typeKey](this.node, opts); }
n/a
isObjectTypeProperty = function (opts) { return t[typeKey](this.node, opts); }
n/a
isParenthesizedExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isPattern = function (opts) { return t[typeKey](this.node, opts); }
n/a
isProgram = function (opts) { return t[typeKey](this.node, opts); }
...
var passedShadowFunction = false;
var fnPath = path.find(function (innerPath) {
if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value"
;) {
return true;
}
if (path === innerPath) return false;
if (innerPath.isProgram() || innerPath.isFunction()) {
currentFunction = currentFunction || innerPath;
}
if (innerPath.isProgram()) {
passedShadowFunction = true;
return true;
...
isProperty = function (opts) { return t[typeKey](this.node, opts); }
n/a
isPure = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isPureish = function (opts) { return t[typeKey](this.node, opts); }
n/a
isQualifiedTypeIdentifier = function (opts) { return t[typeKey](this.node, opts); }
n/a
isReferenced = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isReferencedIdentifier = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isReferencedMemberExpression = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isRegExpLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isRegexLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isRestElement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isRestProperty = function (opts) { return t[typeKey](this.node, opts); }
n/a
isReturnStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isScopable = function (opts) { return t[typeKey](this.node, opts); }
n/a
isScope = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isSequenceExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isSpreadElement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isSpreadProperty = function (opts) { return t[typeKey](this.node, opts); }
n/a
isStatement = function (opts) { return virtualType.checkPath(this, opts); }
...
var node = path.node;
var source = node.source ? node.source.value : null;
var exports = file.metadata.modules.exports;
var declar = path.get("declaration");
if (declar.isStatement()) {
var bindings = declar.getBindingIdentifiers();
for (var name in bindings) {
exports.exported.push(name);
exports.specifiers.push({
kind: "local",
local: name,
...
function isStatementOrBlock() { if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) { return false; } else { return (0, _includes2.default)(t.STATEMENT_OR_BLOCK_KEYS, this.key); } }
n/a
function isStatic() { return this.scope.isStatic(this.node); }
n/a
isStringLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isStringLiteralTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isStringTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isSuper = function (opts) { return t[typeKey](this.node, opts); }
...
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SUPER_THIS_BOUND = (0, _symbol2.default)("super this bound");
var superVisitor = {
CallExpression: function CallExpression(path) {
if (!path.get("callee").isSuper()) return;
var node = path.node;
if (node[SUPER_THIS_BOUND]) return;
node[SUPER_THIS_BOUND] = true;
path.replaceWith(t.assignmentExpression("=", this.id, node));
...
isSwitchCase = function (opts) { return t[typeKey](this.node, opts); }
n/a
isSwitchStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTaggedTemplateExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTemplateElement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTemplateLiteral = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTerminatorless = function (opts) { return t[typeKey](this.node, opts); }
n/a
isThisExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isThisTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isThrowStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTryStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTupleTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTypeAlias = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTypeCastExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTypeParameter = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTypeParameterDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTypeParameterInstantiation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isTypeofTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isUnaryExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isUnaryLike = function (opts) { return t[typeKey](this.node, opts); }
n/a
isUnionTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isUpdateExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
isUser = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isUserWhitespacable = function (opts) { return t[typeKey](this.node, opts); }
n/a
isVar = function (opts) { return virtualType.checkPath(this, opts); }
n/a
isVariableDeclaration = function (opts) { return t[typeKey](this.node, opts); }
n/a
isVariableDeclarator = function (opts) { return t[typeKey](this.node, opts); }
n/a
isVoidTypeAnnotation = function (opts) { return t[typeKey](this.node, opts); }
n/a
isWhile = function (opts) { return t[typeKey](this.node, opts); }
n/a
isWhileStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isWithStatement = function (opts) { return t[typeKey](this.node, opts); }
n/a
isYieldExpression = function (opts) { return t[typeKey](this.node, opts); }
n/a
function isnt(key) { return !this.has(key); }
n/a
function mark(type, message) { this.hub.file.metadata.marked.push({ type: type, message: message, loc: this.node.loc }); }
n/a
function matchesPattern(pattern, allowPartial) { if (!this.isMemberExpression()) return false; var parts = pattern.split("."); var search = [this.node]; var i = 0; function matches(name) { var part = parts[i]; return part === "*" || name === part; } while (search.length) { var node = search.shift(); if (allowPartial && i === parts.length) { return true; } if (t.isIdentifier(node)) { if (!matches(node.name)) return false; } else if (t.isLiteral(node)) { if (!matches(node.value)) return false; } else if (t.isMemberExpression(node)) { if (node.computed && !t.isLiteral(node.property)) { return false; } else { search.unshift(node.property); search.unshift(node.object); continue; } } else if (t.isThisExpression(node)) { if (!matches("this")) return false; } else { return false; } if (++i > parts.length) { return false; } } return i === parts.length; }
n/a
function popContext() { this.contexts.pop(); this.setContext(this.contexts[this.contexts.length - 1]); }
n/a
function pushContainer(listKey, nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); var container = this.node[listKey]; var path = _index2.default.get({ parentPath: this, parent: this.node, container: container, listKey: listKey, key: container.length }); return path.replaceWithMultiple(nodes); }
n/a
function pushContext(context) { this.contexts.push(context); this.setContext(context); }
n/a
function referencesImport(moduleSource, importName) { if (!this.isReferencedIdentifier()) return false; var binding = this.scope.getBinding(this.node.name); if (!binding || binding.kind !== "module") return false; var path = binding.path; var parent = path.parentPath; if (!parent.isImportDeclaration()) return false; if (parent.node.source.value === moduleSource) { if (!importName) return true; } else { return false; } if (path.isImportDefaultSpecifier() && importName === "default") { return true; } if (path.isImportNamespaceSpecifier() && importName === "*") { return true; } if (path.isImportSpecifier() && path.node.imported.name === importName) { return true; } return false; }
n/a
function remove() { this._assertUnremoved(); this.resync(); if (this._callRemovalHooks()) { this._markRemoved(); return; } this.shareCommentsWithSiblings(); this._remove(); this._markRemoved(); }
n/a
function replaceExpressionWithStatements(nodes) { this.resync(); var toSequenceExpression = t.toSequenceExpression(nodes, this.scope); if (t.isSequenceExpression(toSequenceExpression)) { var exprs = toSequenceExpression.expressions; if (exprs.length >= 2 && this.parentPath.isExpressionStatement()) { this._maybePopFromStatements(exprs); } if (exprs.length === 1) { this.replaceWith(exprs[0]); } else { this.replaceWith(toSequenceExpression); } } else if (toSequenceExpression) { this.replaceWith(toSequenceExpression); } else { var container = t.functionExpression(null, [], t.blockStatement(nodes)); container.shadow = true; this.replaceWith(t.callExpression(container, [])); this.traverse(hoistVariablesVisitor); var completionRecords = this.get("callee").getCompletionRecords(); for (var _iterator2 = completionRecords, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var path = _ref2; if (!path.isExpressionStatement()) continue; var loop = path.findParent(function (path) { return path.isLoop(); }); if (loop) { var uid = loop.getData("expressionReplacementReturnUid"); if (!uid) { var callee = this.get("callee"); uid = callee.scope.generateDeclaredUidIdentifier("ret"); callee.get("body").pushContainer("body", t.returnStatement(uid)); loop.setData("expressionReplacementReturnUid", uid); } else { uid = t.identifier(uid.name); } path.get("expression").replaceWith(t.assignmentExpression("=", uid, path.node.expression)); } else { path.replaceWith(t.returnStatement(path.node.expression)); } } return this.node; } }
n/a
function replaceInline(nodes) { this.resync(); if (Array.isArray(nodes)) { if (Array.isArray(this.container)) { nodes = this._verifyNodeList(nodes); this._containerInsertAfter(nodes); return this.remove(); } else { return this.replaceWithMultiple(nodes); } } else { return this.replaceWith(nodes); } }
n/a
function replaceWith(replacement) { this.resync(); if (this.removed) { throw new Error("You can't replace this node, we've already removed it"); } if (replacement instanceof _index4.default) { replacement = replacement.node; } if (!replacement) { throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead"); } if (this.node === replacement) { return; } if (this.isProgram() && !t.isProgram(replacement)) { throw new Error("You can only replace a Program root node with another Program node"); } if (Array.isArray(replacement)) { throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`"); } if (typeof replacement === "string") { throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`"); } if (this.isNodeType("Statement") && t.isExpression(replacement)) { if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { replacement = t.expressionStatement(replacement); } } if (this.isNodeType("Expression") && t.isStatement(replacement)) { if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { return this.replaceExpressionWithStatements([replacement]); } } var oldNode = this.node; if (oldNode) { t.inheritsComments(replacement, oldNode); t.removeComments(oldNode); } this._replaceWith(replacement); this.type = replacement.type; this.setScope(); this.requeue(); }
...
if (!path.get("callee").isSuper()) return;
var node = path.node;
if (node[SUPER_THIS_BOUND]) return;
node[SUPER_THIS_BOUND] = true;
path.replaceWith(t.assignmentExpression("=", this.id, node));
}
};
exports.default = new _plugin2.default({
name: "internal.shadowFunctions",
visitor: {
...
function replaceWithMultiple(nodes) { this.resync(); nodes = this._verifyNodeList(nodes); t.inheritLeadingComments(nodes[0], this.node); t.inheritTrailingComments(nodes[nodes.length - 1], this.node); this.node = this.container[this.key] = null; this.insertAfter(nodes); if (this.node) { this.requeue(); } else { this.remove(); } }
n/a
function replaceWithSourceString(replacement) { this.resync(); try { replacement = "(" + replacement + ")"; replacement = (0, _babylon.parse)(replacement); } catch (err) { var loc = err.loc; if (loc) { err.message += " - make sure this is an expression."; err.message += "\n" + (0, _babelCodeFrame2.default)(replacement, loc.line, loc.column + 1); } throw err; } replacement = replacement.program.body[0].expression; _index2.default.removeProperties(replacement); return this.replaceWith(replacement); }
n/a
function requeue() { var pathToQueue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this; if (pathToQueue.removed) return; var contexts = this.contexts; for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var context = _ref2; context.maybeQueue(pathToQueue); } }
n/a
function resolve(dangerous, resolved) { return this._resolve(dangerous, resolved) || this; }
n/a
function resync() { if (this.removed) return; this._resyncParent(); this._resyncList(); this._resyncKey(); }
n/a
function set(key, node) { t.validate(this.node, key, node); this.node[key] = node; }
...
Store.prototype.get = function get(key) {
if (this.has(key)) {
return _Map.prototype.get.call(this, key);
} else {
if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) {
var val = this.dynamicData[key]();
this.set(key, val);
return val;
}
}
};
return Store;
}(_map2.default);
...
function setContext(context) { this.shouldSkip = false; this.shouldStop = false; this.removed = false; this.skipKeys = {}; if (context) { this.context = context; this.state = context.state; this.opts = context.opts; } this.setScope(); return this; }
n/a
function setData(key, val) { return this.data[key] = val; }
...
if (!passedShadowFunction) return;
var cached = fnPath.getData(key);
if (cached) return path.replaceWith(cached);
var id = path.scope.generateUidIdentifier(key);
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
...
function setKey(key) { this.key = key; this.node = this.container[this.key]; this.type = this.node && this.node.type; }
n/a
function setScope() { if (this.opts && this.opts.noScope) return; var target = this.context && this.context.scope; if (!target) { var path = this.parentPath; while (path && !target) { if (path.opts && path.opts.noScope) return; target = path.scope; path = path.parentPath; } } this.scope = this.getScope(target); if (this.scope) this.scope.init(); }
n/a
function setup(parentPath, container, listKey, key) { this.inList = !!listKey; this.listKey = listKey; this.parentKey = listKey || key; this.container = container; this.parentPath = parentPath || this.parentPath; this.setKey(key); }
n/a
function shareCommentsWithSiblings() { if (typeof this.key === "string") return; var node = this.node; if (!node) return; var trailing = node.trailingComments; var leading = node.leadingComments; if (!trailing && !leading) return; var prev = this.getSibling(this.key - 1); var next = this.getSibling(this.key + 1); if (!prev.node) prev = next; if (!next.node) next = prev; prev.addComments("trailing", leading); next.addComments("leading", trailing); }
n/a
function skip() { this.shouldSkip = true; }
...
kind: "external-all",
source: source
});
}
}
function Scope(path) {
path.skip();
}
...
function skipKey(key) { this.skipKeys[key] = true; }
n/a
function stop() { this.shouldStop = true; this.shouldSkip = true; }
n/a
function toComputedKey() { var node = this.node; var key = void 0; if (this.isMemberExpression()) { key = node.property; } else if (this.isProperty() || this.isMethod()) { key = node.key; } else { throw new ReferenceError("todo"); } if (!node.computed) { if (t.isIdentifier(key)) key = t.stringLiteral(key.name); } return key; }
n/a
function traverse(visitor, state) { (0, _index2.default)(this.node, visitor, this.scope, state, this); }
...
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
fnPath.scope.push({ id: id, init: init });
}
...
function unshiftContainer(listKey, nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); var path = _index2.default.get({ parentPath: this, parent: this.node, container: this.node[listKey], listKey: listKey, key: 0 }); return path.insertBefore(nodes); }
n/a
function updateSiblingKeys(fromIndex, incrementBy) { if (!this.parent) return; var paths = _cache.path.get(this.parent); for (var i = 0; i < paths.length; i++) { var path = paths[i]; if (path.key >= fromIndex) { path.key += incrementBy; } } }
n/a
function visit() { if (!this.node) { return false; } if (this.isBlacklisted()) { return false; } if (this.opts.shouldSkip && this.opts.shouldSkip(this)) { return false; } if (this.call("enter") || this.shouldSkip) { this.debug(function () { return "Skip..."; }); return this.shouldStop; } this.debug(function () { return "Recursing into..."; }); _index2.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys); this.call("exit"); return this.shouldStop; }
n/a
function willIMaybeExecuteBefore(target) { return this._guessExecutionStatusRelativeTo(target) !== "after"; }
n/a
function Scope(path, parentScope) { (0, _classCallCheck3.default)(this, Scope); if (parentScope && parentScope.block === path.node) { return parentScope; } var cached = getCache(path, parentScope, this); if (cached) return cached; this.uid = uid++; this.parent = parentScope; this.hub = path.hub; this.parentBlock = path.parent; this.block = path.node; this.path = path; this.labels = new _map2.default(); }
n/a
function _crawl() { var path = this.path; this.references = (0, _create2.default)(null); this.bindings = (0, _create2.default)(null); this.globals = (0, _create2.default)(null); this.uids = (0, _create2.default)(null); this.data = (0, _create2.default)(null); if (path.isLoop()) { for (var _iterator14 = t.FOR_INIT_KEYS, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, _getIterator3.default)(_iterator14);;) { var _ref14; if (_isArray14) { if (_i14 >= _iterator14.length) break; _ref14 = _iterator14[_i14++]; } else { _i14 = _iterator14.next(); if (_i14.done) break; _ref14 = _i14.value; } var key = _ref14; var node = path.get(key); if (node.isBlockScoped()) this.registerBinding(node.node.kind, node); } } if (path.isFunctionExpression() && path.has("id")) { if (!path.get("id").node[t.NOT_LOCAL_BINDING]) { this.registerBinding("local", path.get("id"), path); } } if (path.isClassExpression() && path.has("id")) { if (!path.get("id").node[t.NOT_LOCAL_BINDING]) { this.registerBinding("local", path); } } if (path.isFunction()) { var params = path.get("params"); for (var _iterator15 = params, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : ( 0, _getIterator3.default)(_iterator15);;) { var _ref15; if (_isArray15) { if (_i15 >= _iterator15.length) break; _ref15 = _iterator15[_i15++]; } else { _i15 = _iterator15.next(); if (_i15.done) break; _ref15 = _i15.value; } var param = _ref15; this.registerBinding("param", param); } } if (path.isCatchClause()) { this.registerBinding("let", path); } var parent = this.getProgramParent(); if (parent.crawling) return; var state = { references: [], constantViolations: [], assignments: [] }; this.crawling = true; path.traverse(collectorVisitor, state); this.crawling = false; for (var _iterator16 = state.assignments, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, _getIterator3.default)(_iterator16);;) { var _ref16; if (_isArray16) { if (_i16 >= _iterator16.length) break; _ref16 = _iterator16[_i16++]; } else { _i16 = _iterator16.next(); if (_i16.done) break; _ref16 = _i16.value; } var _path = _ref16; var ids = _path.getBindingIdentifiers(); var programParent = void 0; for (var name in ids) { if (_path.scope.getBinding(name)) continue; programParent = programParent || _path.scope.getProgramParent(); programParent.addGlobal(ids[name]); } _path.scope.registerConstantViolation(_path); } for (var _iterator17 = state.references, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, _getIterator3.default)(_iterator17);;) { var _ref17; if (_isArray17) { if (_i17 >= _iterator17.length) break; _ref17 = _iterator17[_i17++]; } else { _i17 = _iterator17.next(); if (_i17.done) break; _ref17 = _i17.value; } var ref = _ref17; var binding = ref.scope.getBinding(ref.node.name); if (binding) { binding.reference(ref); } else { ref.scope.getProgramParent().addGlobal(ref.node); } } for (var _iterator18 = state.constantViolations, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, _getIterator3.default)(_iterator18);;) { var _ref18; if (_isArray18) { if (_i18 >= _iterator18.length) break; _ref18 = _iterator18[_i18++]; } else { _i18 = _iterator18.next(); if (_i18.done) break; _ref18 = _i18.value; } var _path2 = _ref18; _path2.scope.registerConstantViolation(_path2); } }
n/a
function _generateUid(name, i) { var id = name; if (i > 1) id += i; return "_" + id; }
n/a
function _renameFromMap(map, oldName, newName, value) { if (map[oldName]) { map[newName] = value; map[oldName] = null; } }
n/a
function addGlobal(node) { this.globals[node.name] = node; }
n/a
function bindingIdentifierEquals(name, node) { return this.getBindingIdentifier(name) === node; }
n/a
function buildUndefinedNode() { if (this.hasBinding("undefined")) { return t.unaryExpression("void", t.numericLiteral(0), true); } else { return t.identifier("undefined"); } }
n/a
function checkBlockScopedCollisions(local, kind, name, id) { if (kind === "param") return; if (kind === "hoisted" && local.kind === "let") return; var duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === " param" && (kind === "let" || kind === "const"); if (duplicate) { throw this.hub.file.buildCodeFrameError(id, messages.get("scopeDuplicateDeclaration", name), TypeError); } }
n/a
function crawl() { _crawlCallsCount++; this._crawl(); _crawlCallsCount--; }
n/a
function dump() { var sep = (0, _repeat2.default)("-", 60); console.log(sep); var scope = this; do { console.log("#", scope.block.type); for (var name in scope.bindings) { var binding = scope.bindings[name]; console.log(" -", name, { constant: binding.constant, references: binding.references, violations: binding.constantViolations.length, kind: binding.kind }); } } while (scope = scope.parent); console.log(sep); }
n/a
function generateDeclaredUidIdentifier() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; var id = this.generateUidIdentifier(name); this.push({ id: id }); return id; }
n/a
function generateUid() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, ""); var uid = void 0; var i = 0; do { uid = this._generateUid(name, i); i++; } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid)); var program = this.getProgramParent(); program.references[uid] = true; program.uids[uid] = true; return uid; }
n/a
function generateUidIdentifier() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; return t.identifier(this.generateUid(name)); }
...
if (fnPath === currentFunction) return;
if (!passedShadowFunction) return;
var cached = fnPath.getData(key);
if (cached) return path.replaceWith(cached);
var id = path.scope.generateUidIdentifier(key);
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
...
function generateUidIdentifierBasedOnNode(parent, defaultName) { var node = parent; if (t.isAssignmentExpression(parent)) { node = parent.left; } else if (t.isVariableDeclarator(parent)) { node = parent.id; } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) { node = node.key; } var parts = []; gatherNodeParts(node, parts); var id = parts.join("$"); id = id.replace(/^_/, "") || defaultName || "ref"; return this.generateUidIdentifier(id.slice(0, 20)); }
n/a
function getAllBindings() { var ids = (0, _create2.default)(null); var scope = this; do { (0, _defaults2.default)(ids, scope.bindings); scope = scope.parent; } while (scope); return ids; }
n/a
function getAllBindingsOfKind() { var ids = (0, _create2.default)(null); for (var _iterator19 = arguments, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : ( 0, _getIterator3.default)(_iterator19);;) { var _ref19; if (_isArray19) { if (_i19 >= _iterator19.length) break; _ref19 = _iterator19[_i19++]; } else { _i19 = _iterator19.next(); if (_i19.done) break; _ref19 = _i19.value; } var kind = _ref19; var scope = this; do { for (var name in scope.bindings) { var binding = scope.bindings[name]; if (binding.kind === kind) ids[name] = binding; } scope = scope.parent; } while (scope); } return ids; }
n/a
function getBinding(name) { var scope = this; do { var binding = scope.getOwnBinding(name); if (binding) return this.warnOnFlowBinding(binding); } while (scope = scope.parent); }
n/a
function getBindingIdentifier(name) { var info = this.getBinding(name); return info && info.identifier; }
n/a
function getBlockParent() { var scope = this; do { if (scope.path.isBlockParent()) { return scope; } } while (scope = scope.parent); throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program..."); }
n/a
function getData(key) { var scope = this; do { var data = scope.data[key]; if (data != null) return data; } while (scope = scope.parent); }
...
});
}
if (fnPath === currentFunction) return;
if (!passedShadowFunction) return;
var cached = fnPath.getData(key);
if (cached) return path.replaceWith(cached);
var id = path.scope.generateUidIdentifier(key);
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
...
function getFunctionParent() { var scope = this; do { if (scope.path.isFunctionParent()) { return scope; } } while (scope = scope.parent); throw new Error("We couldn't find a Function or Program..."); }
n/a
function getLabel(name) { return this.labels.get(name); }
n/a
function getOwnBinding(name) { return this.warnOnFlowBinding(this.bindings[name]); }
n/a
function getOwnBindingIdentifier(name) { var binding = this.bindings[name]; return binding && binding.identifier; }
n/a
function getProgramParent() { var scope = this; do { if (scope.path.isProgram()) { return scope; } } while (scope = scope.parent); throw new Error("We couldn't find a Function or Program..."); }
n/a
function hasBinding(name, noGlobals) { if (!name) return false; if (this.hasOwnBinding(name)) return true; if (this.parentHasBinding(name, noGlobals)) return true; if (this.hasUid(name)) return true; if (!noGlobals && (0, _includes2.default)(Scope.globals, name)) return true; if (!noGlobals && (0, _includes2.default)(Scope.contextVariables, name)) return true; return false; }
n/a
function hasGlobal(name) { var scope = this; do { if (scope.globals[name]) return true; } while (scope = scope.parent); return false; }
n/a
function hasLabel(name) { return !!this.getLabel(name); }
n/a
function hasOwnBinding(name) { return !!this.getOwnBinding(name); }
n/a
function hasReference(name) { var scope = this; do { if (scope.references[name]) return true; } while (scope = scope.parent); return false; }
n/a
function hasUid(name) { var scope = this; do { if (scope.uids[name]) return true; } while (scope = scope.parent); return false; }
n/a
function init() { if (!this.references) this.crawl(); }
n/a
function isPure(node, constantsOnly) { if (t.isIdentifier(node)) { var binding = this.getBinding(node.name); if (!binding) return false; if (constantsOnly) return binding.constant; return true; } else if (t.isClass(node)) { if (node.superClass && !this.isPure(node.superClass, constantsOnly)) return false; return this.isPure(node.body, constantsOnly); } else if (t.isClassBody(node)) { for (var _iterator11 = node.body, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : ( 0, _getIterator3.default)(_iterator11);;) { var _ref11; if (_isArray11) { if (_i11 >= _iterator11.length) break; _ref11 = _iterator11[_i11++]; } else { _i11 = _iterator11.next(); if (_i11.done) break; _ref11 = _i11.value; } var method = _ref11; if (!this.isPure(method, constantsOnly)) return false; } return true; } else if (t.isBinary(node)) { return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly); } else if (t.isArrayExpression(node)) { for (var _iterator12 = node.elements, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, _getIterator3.default)(_iterator12);;) { var _ref12; if (_isArray12) { if (_i12 >= _iterator12.length) break; _ref12 = _iterator12[_i12++]; } else { _i12 = _iterator12.next(); if (_i12.done) break; _ref12 = _i12.value; } var elem = _ref12; if (!this.isPure(elem, constantsOnly)) return false; } return true; } else if (t.isObjectExpression(node)) { for (var _iterator13 = node.properties, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, _getIterator3.default)(_iterator13);;) { var _ref13; if (_isArray13) { if (_i13 >= _iterator13.length) break; _ref13 = _iterator13[_i13++]; } else { _i13 = _iterator13.next(); if (_i13.done) break; _ref13 = _i13.value; } var prop = _ref13; if (!this.isPure(prop, constantsOnly)) return false; } return true; } else if (t.isClassMethod(node)) { if (node.computed && !this.isPure(node.key, constantsOnly)) return false; if (node.kind === "get" || node.kind === "set") return false; return true; } else if (t.isClassProperty(node) || t.isObjectProperty(node)) { if (node.computed && !this.isPure(node.key, constantsOnly)) return false; return this.isPure(node.value, constantsOnly); } else if (t.isUnaryExpression(node)) { return this.isPure(node.argument, constantsOnly); } else { return t.isPureish(node); } }
n/a
function isStatic(node) { if (t.isThisExpression(node) || t.isSuper(node)) { return true; } if (t.isIdentifier(node)) { var binding = this.getBinding(node.name); if (binding) { return binding.constant; } else { return this.hasBinding(node.name); } } return false; }
n/a
function maybeGenerateMemoised(node, dontPush) { if (this.isStatic(node)) { return null; } else { var _id2 = this.generateUidIdentifierBasedOnNode(node); if (!dontPush) this.push({ id: _id2 }); return _id2; } }
n/a
function moveBindingTo(name, scope) { var info = this.getBinding(name); if (info) { info.scope.removeOwnBinding(name); info.scope = scope; scope.bindings[name] = info; } }
n/a
function parentHasBinding(name, noGlobals) { return this.parent && this.parent.hasBinding(name, noGlobals); }
n/a
function push(opts) { var path = this.path; if (!path.isBlockStatement() && !path.isProgram()) { path = this.getBlockParent().path; } if (path.isSwitchStatement()) { path = this.getFunctionParent().path; } if (path.isLoop() || path.isCatchClause() || path.isFunction()) { t.ensureBlock(path.node); path = path.get("body"); } var unique = opts.unique; var kind = opts.kind || "var"; var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist; var dataKey = "declaration:" + kind + ":" + blockHoist; var declarPath = !unique && path.getData(dataKey); if (!declarPath) { var declar = t.variableDeclaration(kind, []); declar._generated = true; declar._blockHoist = blockHoist; var _path$unshiftContaine = path.unshiftContainer("body", [declar]); declarPath = _path$unshiftContaine[0]; if (!unique) path.setData(dataKey, declarPath); } var declarator = t.variableDeclarator(opts.id, opts.init); declarPath.node.declarations.push(declarator); this.registerBinding(kind, declarPath.get("declarations").pop()); }
...
}
}
var _scripts = global.document.getElementsByTagName("script");
for (var i = 0; i < _scripts.length; ++i) {
var _script = _scripts[i];
if (types.indexOf(_script.type) >= 0) scripts.push(_script);
}
for (var _i = 0; _i < scripts.length; _i++) {
run(scripts[_i], _i);
}
exec();
...
function registerBinding(kind, path) { var bindingPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : path; if (!kind) throw new ReferenceError("no `kind`"); if (path.isVariableDeclaration()) { var declarators = path.get("declarations"); for (var _iterator9 = declarators, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) { var _ref9; if (_isArray9) { if (_i9 >= _iterator9.length) break; _ref9 = _iterator9[_i9++]; } else { _i9 = _iterator9.next(); if (_i9.done) break; _ref9 = _i9.value; } var declar = _ref9; this.registerBinding(kind, declar); } return; } var parent = this.getProgramParent(); var ids = path.getBindingIdentifiers(true); for (var name in ids) { for (var _iterator10 = ids[name], _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : ( 0, _getIterator3.default)(_iterator10);;) { var _ref10; if (_isArray10) { if (_i10 >= _iterator10.length) break; _ref10 = _iterator10[_i10++]; } else { _i10 = _iterator10.next(); if (_i10.done) break; _ref10 = _i10.value; } var _id3 = _ref10; var local = this.getOwnBinding(name); if (local) { if (local.identifier === _id3) continue; this.checkBlockScopedCollisions(local, kind, name, _id3); } if (local && local.path.isFlow()) local = null; parent.references[name] = true; this.bindings[name] = new _binding3.default({ identifier: _id3, existing: local, scope: this, path: bindingPath, kind: kind }); } } }
n/a
function registerConstantViolation(path) { var ids = path.getBindingIdentifiers(); for (var name in ids) { var binding = this.getBinding(name); if (binding) binding.reassign(path); } }
n/a
function registerDeclaration(path) { if (path.isLabeledStatement()) { this.registerLabel(path); } else if (path.isFunctionDeclaration()) { this.registerBinding("hoisted", path.get("id"), path); } else if (path.isVariableDeclaration()) { var declarations = path.get("declarations"); for (var _iterator7 = declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0 , _getIterator3.default)(_iterator7);;) { var _ref7; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref7 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref7 = _i7.value; } var declar = _ref7; this.registerBinding(path.node.kind, declar); } } else if (path.isClassDeclaration()) { this.registerBinding("let", path); } else if (path.isImportDeclaration()) { var specifiers = path.get("specifiers"); for (var _iterator8 = specifiers, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) { var _ref8; if (_isArray8) { if (_i8 >= _iterator8.length) break; _ref8 = _iterator8[_i8++]; } else { _i8 = _iterator8.next(); if (_i8.done) break; _ref8 = _i8.value; } var specifier = _ref8; this.registerBinding("module", specifier); } } else if (path.isExportDeclaration()) { var _declar = path.get("declaration"); if (_declar.isClassDeclaration() || _declar.isFunctionDeclaration() || _declar.isVariableDeclaration()) { this.registerDeclaration(_declar); } } else { this.registerBinding("unknown", path); } }
n/a
function registerLabel(path) { this.labels.set(path.node.label.name, path); }
n/a
function removeBinding(name) { var info = this.getBinding(name); if (info) { info.scope.removeOwnBinding(name); } var scope = this; do { if (scope.uids[name]) { scope.uids[name] = false; } } while (scope = scope.parent); }
n/a
function removeData(key) { var scope = this; do { var data = scope.data[key]; if (data != null) scope.data[key] = null; } while (scope = scope.parent); }
n/a
function removeOwnBinding(name) { delete this.bindings[name]; }
n/a
function rename(oldName, newName, block) { var binding = this.getBinding(oldName); if (binding) { newName = newName || this.generateUidIdentifier(oldName).name; return new _renamer2.default(binding, oldName, newName).rename(block); } }
n/a
function setData(key, val) { return this.data[key] = val; }
...
if (!passedShadowFunction) return;
var cached = fnPath.getData(key);
if (cached) return path.replaceWith(cached);
var id = path.scope.generateUidIdentifier(key);
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
...
function toArray(node, i) { var file = this.hub.file; if (t.isIdentifier(node)) { var binding = this.getBinding(node.name); if (binding && binding.constant && binding.path.isGenericType("Array")) return node; } if (t.isArrayExpression(node)) { return node; } if (t.isIdentifier(node, { name: "arguments" })) { return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Array"), t.identifier("prototype ")), t.identifier("slice")), t.identifier("call")), [node]); } var helperName = "toArray"; var args = [node]; if (i === true) { helperName = "toConsumableArray"; } else if (i) { args.push(t.numericLiteral(i)); helperName = "slicedToArray"; } return t.callExpression(file.addHelper(helperName), args); }
n/a
function traverse(node, opts, state) { (0, _index2.default)(node, opts, this, state, this.path); }
...
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
fnPath.scope.push({ id: id, init: init });
}
...
function warnOnFlowBinding(binding) { if (_crawlCallsCount === 0 && binding && binding.path.isFlow()) { console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 6.8. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n "); } return binding; }
n/a
clearCache = function () { cache.clear(); }
n/a
function clearPath() { exports.path = path = new _weakMap2.default(); }
n/a
function clearScope() { exports.scope = scope = new _weakMap2.default(); }
n/a
function explode(visitor) { if (visitor._exploded) return visitor; visitor._exploded = true; for (var nodeType in visitor) { if (shouldIgnoreKey(nodeType)) continue; var parts = nodeType.split("|"); if (parts.length === 1) continue; var fns = visitor[nodeType]; delete visitor[nodeType]; for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var part = _ref; visitor[part] = fns; } } verify(visitor); delete visitor.__esModule; ensureEntranceObjects(visitor); ensureCallbackArrays(visitor); for (var _iterator2 = (0, _keys2.default)(visitor), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _nodeType3 = _ref2; if (shouldIgnoreKey(_nodeType3)) continue; var wrapper = virtualTypes[_nodeType3]; if (!wrapper) continue; var _fns2 = visitor[_nodeType3]; for (var type in _fns2) { _fns2[type] = wrapCheck(wrapper, _fns2[type]); } delete visitor[_nodeType3]; if (wrapper.types) { for (var _iterator4 = wrapper.types, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : ( 0, _getIterator3.default)(_iterator4);;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var _type = _ref4; if (visitor[_type]) { mergePair(visitor[_type], _fns2); } else { visitor[_type] = _fns2; } } } else { mergePair(visitor, _fns2); } } for (var _nodeType in visitor) { if (shouldIgnoreKey(_nodeType)) continue; var _fns = visitor[_nodeType]; var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType]; var deprecratedKey = t.DEPRECATED_KEYS[_nodeType]; if (deprecratedKey) { console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey); aliases = [deprecratedKey]; } if (!aliases) continue; delete visitor[_nodeType]; for (var _iterator3 = aliases, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3 .default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var alias = _ref3; var existing = visitor[alias]; if (existing) { mergePair(existing, _fns); } else { visitor[alias] = (0, _clone2.default)(_fns); } } } for (var _nodeType2 in visitor) { if (shouldIgnoreKey(_nodeType2)) continue; ensureCallbackArrays(visitor[_nodeType2]); } return visitor; }
...
var key = _ref2;
if (visitor[key]) {
throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target
individual nodes.");
}
}
_babelTraverse2.default.explode(visitor);
return visitor;
};
return Plugin;
}(_store2.default);
exports.default = Plugin;
...
function merge(visitors) { var states = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var wrapper = arguments[2]; var rootVisitor = {}; for (var i = 0; i < visitors.length; i++) { var visitor = visitors[i]; var state = states[i]; explode(visitor); for (var type in visitor) { var visitorType = visitor[type]; if (state || wrapper) { visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper); } var nodeVisitor = rootVisitor[type] = rootVisitor[type] || {}; mergePair(nodeVisitor, visitorType); } } return rootVisitor; }
...
if (!inherits) return;
inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits");
this.manipulateOptions = this.chain(inherits, "manipulateOptions");
this.post = this.chain(inherits, "post");
this.pre = this.chain(inherits, "pre");
this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor
]);
};
Plugin.prototype.init = function init(loc, i) {
if (this.initialized) return;
this.initialized = true;
this.maybeInherit(loc);
...
function verify(visitor) { if (visitor._verified) return; if (typeof visitor === "function") { throw new Error(messages.get("traverseVerifyRootFunction")); } for (var nodeType in visitor) { if (nodeType === "enter" || nodeType === "exit") { validateVisitorMethods(nodeType, visitor[nodeType]); } if (shouldIgnoreKey(nodeType)) continue; if (t.TYPES.indexOf(nodeType) < 0) { throw new Error(messages.get("traverseVerifyNodeType", nodeType)); } var visitors = visitor[nodeType]; if ((typeof visitors === "undefined" ? "undefined" : (0, _typeof3.default)(visitors)) === "object") { for (var visitorKey in visitors) { if (visitorKey === "enter" || visitorKey === "exit") { validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]); } else { throw new Error(messages.get("traverseVerifyVisitorProperty", nodeType, visitorKey)); } } } } visitor._verified = true; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
NumberLiteral = function () { console.trace("The node type " + _type + " has been renamed to " + newType); return fn.apply(this, arguments); }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
RegexLiteral = function () { console.trace("The node type " + _type + " has been renamed to " + newType); return fn.apply(this, arguments); }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function appendToMemberExpression(member, append, computed) { member.object = t.memberExpression(member.object, member.property, member.computed); member.property = append; member.computed = !!computed; return member; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
assertAnyTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertArrayExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertArrayPattern = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertArrayTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertArrowFunctionExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertAssignmentExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertAssignmentPattern = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertAwaitExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBinary = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBinaryExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBindExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBlock = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBlockParent = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBlockStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBooleanLiteral = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBooleanLiteralTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBooleanTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertBreakStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertCallExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertCatchClause = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertClass = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertClassBody = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertClassDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertClassExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertClassImplements = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertClassMethod = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertClassProperty = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertCompletionStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertConditional = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertConditionalExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertContinueStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDebuggerStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDeclareClass = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDeclareFunction = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDeclareInterface = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDeclareModule = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDeclareModuleExports = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDeclareTypeAlias = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDeclareVariable = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDecorator = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDirective = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDirectiveLiteral = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDoExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertDoWhileStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertEmptyStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertEmptyTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExistentialTypeParam = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExportAllDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExportDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExportDefaultDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExportDefaultSpecifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExportNamedDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExportNamespaceSpecifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExportSpecifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExpressionStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertExpressionWrapper = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFile = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFlow = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFlowBaseAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFlowDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFor = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertForAwaitStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertForInStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertForOfStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertForStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertForXStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFunction = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFunctionDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFunctionExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFunctionParent = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFunctionTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertFunctionTypeParam = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertGenericTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertIdentifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertIfStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertImmutable = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertImport = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertImportDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertImportDefaultSpecifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertImportNamespaceSpecifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertImportSpecifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertInterfaceDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertInterfaceExtends = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertIntersectionTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSX = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXAttribute = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXClosingElement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXElement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXEmptyExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXExpressionContainer = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXIdentifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXMemberExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXNamespacedName = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXOpeningElement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXSpreadAttribute = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXSpreadChild = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertJSXText = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertLVal = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertLabeledStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertLiteral = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertLogicalExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertLoop = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertMemberExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertMetaProperty = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertMethod = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertMixedTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertModuleDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertModuleSpecifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertNewExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
function assertNode(node) { if (!isNode(node)) { throw new TypeError("Not a valid node " + (node && node.type)); } }
n/a
assertNoop = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertNullLiteral = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertNullLiteralTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertNullableTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertNumberLiteral = function () { console.trace("The node type " + _type + " has been renamed to " + newType); return fn.apply(this, arguments); }
n/a
assertNumberTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertNumericLiteral = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertNumericLiteralTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectMember = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectMethod = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectPattern = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectProperty = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectTypeCallProperty = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectTypeIndexer = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertObjectTypeProperty = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertParenthesizedExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertPattern = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertProgram = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertProperty = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertPureish = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertQualifiedTypeIdentifier = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertRegExpLiteral = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertRegexLiteral = function () { console.trace("The node type " + _type + " has been renamed to " + newType); return fn.apply(this, arguments); }
n/a
assertRestElement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertRestProperty = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertReturnStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertScopable = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertSequenceExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertSpreadElement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertSpreadProperty = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertStringLiteral = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertStringLiteralTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertStringTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertSuper = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertSwitchCase = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertSwitchStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTaggedTemplateExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTemplateElement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTemplateLiteral = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTerminatorless = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertThisExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertThisTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertThrowStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTryStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTupleTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTypeAlias = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTypeCastExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTypeParameter = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTypeParameterDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTypeParameterInstantiation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertTypeofTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertUnaryExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertUnaryLike = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertUnionTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertUpdateExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertUserWhitespacable = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertVariableDeclaration = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertVariableDeclarator = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertVoidTypeAnnotation = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertWhile = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertWhileStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertWithStatement = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
assertYieldExpression = function (node, opts) { opts = opts || {}; if (!is(node, opts)) { throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts)); } }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
...
if (!path.get("callee").isSuper()) return;
var node = path.node;
if (node[SUPER_THIS_BOUND]) return;
node[SUPER_THIS_BOUND] = true;
path.replaceWith(t.assignmentExpression("=", this.id, node));
}
};
exports.default = new _plugin2.default({
name: "internal.shadowFunctions",
visitor: {
...
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function buildMatchMemberExpression(match, allowPartial) { var parts = match.split("."); return function (member) { if (!t.isMemberExpression(member)) return false; var search = [member]; var i = 0; while (search.length) { var node = search.shift(); if (allowPartial && i === parts.length) { return true; } if (t.isIdentifier(node)) { if (parts[i] !== node.name) return false; } else if (t.isStringLiteral(node)) { if (parts[i] !== node.value) return false; } else if (t.isMemberExpression(node)) { if (node.computed && !t.isStringLiteral(node.property)) { return false; } else { search.push(node.object); search.push(node.property); continue; } } else { return false; } if (++i > parts.length) { return false; } } return true; }; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function clone(node) { if (!node) return node; var newNode = {}; for (var key in node) { if (key[0] === "_") continue; newNode[key] = node[key]; } return newNode; }
n/a
function cloneDeep(node) { if (!node) return node; var newNode = {}; for (var key in node) { if (key[0] === "_") continue; var val = node[key]; if (val) { if (val.type) { val = t.cloneDeep(val); } else if (Array.isArray(val)) { val = val.map(t.cloneDeep); } } newNode[key] = val; } return newNode; }
n/a
function cloneWithoutLoc(node) { var newNode = clone(node); delete newNode.loc; return newNode; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function createTypeAnnotationBasedOnTypeof(type) { if (type === "string") { return t.stringTypeAnnotation(); } else if (type === "number") { return t.numberTypeAnnotation(); } else if (type === "undefined") { return t.voidTypeAnnotation(); } else if (type === "boolean") { return t.booleanTypeAnnotation(); } else if (type === "function") { return t.genericTypeAnnotation(t.identifier("Function")); } else if (type === "object") { return t.genericTypeAnnotation(t.identifier("Object")); } else if (type === "symbol") { return t.genericTypeAnnotation(t.identifier("Symbol")); } else { throw new Error("Invalid typeof value"); } }
n/a
function createUnionTypeAnnotation(types) { var flattened = removeTypeDuplicates(types); if (flattened.length === 1) { return flattened[0]; } else { return t.unionTypeAnnotation(flattened); } }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function ensureBlock(node) { var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "body"; return node[key] = t.toBlock(node[key], node); }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
...
"use strict";
exports.__esModule = true;
exports.default = function (ast, comments, tokens) {
if (ast) {
if (ast.type === "Program") {
return t.file(ast, comments || [], tokens || []);
} else if (ast.type === "File") {
return ast;
}
}
throw new Error("Not a valid ast?");
};
...
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function getBindingIdentifiers(node, duplicates, outerOnly) { var search = [].concat(node); var ids = (0, _create2.default)(null); while (search.length) { var id = search.shift(); if (!id) continue; var keys = t.getBindingIdentifiers.keys[id.type]; if (t.isIdentifier(id)) { if (duplicates) { var _ids = ids[id.name] = ids[id.name] || []; _ids.push(id); } else { ids[id.name] = id; } continue; } if (t.isExportDeclaration(id)) { if (t.isDeclaration(id.declaration)) { search.push(id.declaration); } continue; } if (outerOnly) { if (t.isFunctionDeclaration(id)) { search.push(id.id); continue; } if (t.isFunctionExpression(id)) { continue; } } if (keys) { for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (id[key]) { search = search.concat(id[key]); } } } } return ids; }
...
var source = node.source ? node.source.value : null;
var exports = file.metadata.modules.exports;
var declar = path.get("declaration");
if (declar.isStatement()) {
var bindings = declar.getBindingIdentifiers();
for (var name in bindings) {
exports.exported.push(name);
exports.specifiers.push({
kind: "local",
local: name,
exported: path.isExportDefaultDeclaration() ? "default" : name
...
function getOuterBindingIdentifiers(node, duplicates) { return getBindingIdentifiers(node, duplicates, true); }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
...
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
fnPath.scope.push({ id: id, init: init });
}
return path.replaceWith(id);
...
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function inheritInnerComments(child, parent) { _inheritComments("innerComments", child, parent); }
n/a
function inheritLeadingComments(child, parent) { _inheritComments("leadingComments", child, parent); }
n/a
function inheritTrailingComments(child, parent) { _inheritComments("trailingComments", child, parent); }
n/a
function inherits(child, parent) { if (!child || !parent) return child; for (var _iterator5 = t.INHERIT_KEYS.optional, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { var _ref5; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref5 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref5 = _i5.value; } var _key2 = _ref5; if (child[_key2] == null) { child[_key2] = parent[_key2]; } } for (var key in parent) { if (key[0] === "_") child[key] = parent[key]; } for (var _iterator6 = t.INHERIT_KEYS.force, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { var _ref6; if (_isArray6) { if (_i6 >= _iterator6.length) break; _ref6 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; _ref6 = _i6.value; } var _key3 = _ref6; child[_key3] = parent[_key3]; } t.inheritsComments(child, parent); return child; }
n/a
function inheritsComments(child, parent) { inheritTrailingComments(child, parent); inheritLeadingComments(child, parent); inheritInnerComments(child, parent); return child; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function is(type, node, opts) { if (!node) return false; var matches = isType(node.type, type); if (!matches) return false; if (typeof opts === "undefined") { return true; } else { return t.shallowEqual(node, opts); } }
...
}
}
}
});
function shouldShadow(path, shadowPath) {
if (path.is("_forceShadow")) {
return true;
} else {
return shadowPath;
}
}
function remap(path, key) {
...
isAnyTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isArrayExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isArrayPattern = function (node, opts) { return t.is(type, node, opts); }
n/a
isArrayTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isArrowFunctionExpression = function (node, opts) { return t.is(type, node, opts); }
...
currentFunction = currentFunction || innerPath;
}
if (innerPath.isProgram()) {
passedShadowFunction = true;
return true;
} else if (innerPath.isFunction() && !innerPath.isArrowFunctionExpression()) {
if (shadowFunction) {
if (innerPath === shadowFunction || innerPath.node === shadowFunction.node) return true;
} else {
if (!innerPath.is("shadow")) return true;
}
passedShadowFunction = true;
...
isAssignmentExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isAssignmentPattern = function (node, opts) { return t.is(type, node, opts); }
n/a
isAwaitExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isBinary = function (node, opts) { return t.is(type, node, opts); }
n/a
isBinaryExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isBindExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
function isBinding(node, parent) { var keys = _retrievers.getBindingIdentifiers.keys[parent.type]; if (keys) { for (var i = 0; i < keys.length; i++) { var key = keys[i]; var val = parent[key]; if (Array.isArray(val)) { if (val.indexOf(node) >= 0) return true; } else { if (val === node) return true; } } } return false; }
n/a
isBlock = function (node, opts) { return t.is(type, node, opts); }
n/a
isBlockParent = function (node, opts) { return t.is(type, node, opts); }
n/a
function isBlockScoped(node) { return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node); }
n/a
isBlockStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isBooleanLiteral = function (node, opts) { return t.is(type, node, opts); }
n/a
isBooleanLiteralTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isBooleanTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isBreakStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isCallExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isCatchClause = function (node, opts) { return t.is(type, node, opts); }
n/a
isClass = function (node, opts) { return t.is(type, node, opts); }
...
if (cached) return path.replaceWith(cached);
var id = path.scope.generateUidIdentifier(key);
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
...
isClassBody = function (node, opts) { return t.is(type, node, opts); }
n/a
isClassDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isClassExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isClassImplements = function (node, opts) { return t.is(type, node, opts); }
n/a
isClassMethod = function (node, opts) { return t.is(type, node, opts); }
n/a
isClassProperty = function (node, opts) { return t.is(type, node, opts); }
...
var shadowFunction = path.node._shadowedFunctionLiteral;
var currentFunction = void 0;
var passedShadowFunction = false;
var fnPath = path.find(function (innerPath) {
if (innerPath.parentPath && innerPath.parentPath.isClassProperty() &
x26; innerPath.key === "value") {
return true;
}
if (path === innerPath) return false;
if (innerPath.isProgram() || innerPath.isFunction()) {
currentFunction = currentFunction || innerPath;
}
...
isCompletionStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isConditional = function (node, opts) { return t.is(type, node, opts); }
n/a
isConditionalExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isContinueStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isDebuggerStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isDeclareClass = function (node, opts) { return t.is(type, node, opts); }
n/a
isDeclareFunction = function (node, opts) { return t.is(type, node, opts); }
n/a
isDeclareInterface = function (node, opts) { return t.is(type, node, opts); }
n/a
isDeclareModule = function (node, opts) { return t.is(type, node, opts); }
n/a
isDeclareModuleExports = function (node, opts) { return t.is(type, node, opts); }
n/a
isDeclareTypeAlias = function (node, opts) { return t.is(type, node, opts); }
n/a
isDeclareVariable = function (node, opts) { return t.is(type, node, opts); }
n/a
isDecorator = function (node, opts) { return t.is(type, node, opts); }
n/a
isDirective = function (node, opts) { return t.is(type, node, opts); }
n/a
isDirectiveLiteral = function (node, opts) { return t.is(type, node, opts); }
n/a
isDoExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isDoWhileStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isEmptyStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isEmptyTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isExistentialTypeParam = function (node, opts) { return t.is(type, node, opts); }
n/a
isExportAllDeclaration = function (node, opts) { return t.is(type, node, opts); }
...
local: local.name,
exported: exported
});
}
}
}
if (path.isExportAllDeclaration()) {
exports.specifiers.push({
kind: "external-all",
source: source
});
}
}
...
isExportDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isExportDefaultDeclaration = function (node, opts) { return t.is(type, node, opts); }
...
var bindings = declar.getBindingIdentifiers();
for (var name in bindings) {
exports.exported.push(name);
exports.specifiers.push({
kind: "local",
local: name,
exported: path.isExportDefaultDeclaration() ? "default" : name
});
}
}
if (path.isExportNamedDeclaration() && node.specifiers) {
for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (
0, _getIterator3.default)(_iterator2);;) {
var _ref2;
...
isExportDefaultSpecifier = function (node, opts) { return t.is(type, node, opts); }
...
}
var specifier = _ref2;
var exported = specifier.exported.name;
exports.exported.push(exported);
if (t.isExportDefaultSpecifier(specifier)) {
exports.specifiers.push({
kind: "external",
local: exported,
exported: exported,
source: source
});
}
...
isExportNamedDeclaration = function (node, opts) { return t.is(type, node, opts); }
...
kind: "local",
local: name,
exported: path.isExportDefaultDeclaration() ? "default" : name
});
}
}
if (path.isExportNamedDeclaration() && node.specifiers) {
for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (
0, _getIterator3.default)(_iterator2);;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
} else {
...
isExportNamespaceSpecifier = function (node, opts) { return t.is(type, node, opts); }
...
kind: "external",
local: exported,
exported: exported,
source: source
});
}
if (t.isExportNamespaceSpecifier(specifier)) {
exports.specifiers.push({
kind: "external-namespace",
exported: exported,
source: source
});
}
...
isExportSpecifier = function (node, opts) { return t.is(type, node, opts); }
n/a
isExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isExpressionStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isExpressionWrapper = function (node, opts) { return t.is(type, node, opts); }
n/a
isFile = function (node, opts) { return t.is(type, node, opts); }
n/a
isFlow = function (node, opts) { return t.is(type, node, opts); }
n/a
isFlowBaseAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isFlowDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isFor = function (node, opts) { return t.is(type, node, opts); }
n/a
isForAwaitStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isForInStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isForOfStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isForStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isForXStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isFunction = function (node, opts) { return t.is(type, node, opts); }
...
var passedShadowFunction = false;
var fnPath = path.find(function (innerPath) {
if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value"
;) {
return true;
}
if (path === innerPath) return false;
if (innerPath.isProgram() || innerPath.isFunction()) {
currentFunction = currentFunction || innerPath;
}
if (innerPath.isProgram()) {
passedShadowFunction = true;
return true;
...
isFunctionDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isFunctionExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isFunctionParent = function (node, opts) { return t.is(type, node, opts); }
n/a
isFunctionTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isFunctionTypeParam = function (node, opts) { return t.is(type, node, opts); }
n/a
isGenericTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isIdentifier = function (node, opts) { return t.is(type, node, opts); }
n/a
isIfStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
function isImmutable(node) { if (t.isType(node.type, "Immutable")) return true; if (t.isIdentifier(node)) { if (node.name === "undefined") { return true; } else { return false; } } return false; }
n/a
isImport = function (node, opts) { return t.is(type, node, opts); }
n/a
isImportDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isImportDefaultSpecifier = function (node, opts) { return t.is(type, node, opts); }
...
_ref = _i.value;
}
var specifier = _ref;
var local = specifier.node.local.name;
if (specifier.isImportDefaultSpecifier()) {
imported.push("default");
specifiers.push({
kind: "named",
imported: "default",
local: local
});
}
...
isImportNamespaceSpecifier = function (node, opts) { return t.is(type, node, opts); }
...
specifiers.push({
kind: "named",
imported: importedName,
local: local
});
}
if (specifier.isImportNamespaceSpecifier()) {
imported.push("*");
specifiers.push({
kind: "namespace",
local: local
});
}
}
...
isImportSpecifier = function (node, opts) { return t.is(type, node, opts); }
...
specifiers.push({
kind: "named",
imported: "default",
local: local
});
}
if (specifier.isImportSpecifier()) {
var importedName = specifier.node.imported.name;
imported.push(importedName);
specifiers.push({
kind: "named",
imported: importedName,
local: local
});
...
isInterfaceDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isInterfaceExtends = function (node, opts) { return t.is(type, node, opts); }
n/a
isIntersectionTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSX = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXAttribute = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXClosingElement = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXElement = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXEmptyExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXExpressionContainer = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXIdentifier = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXMemberExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXNamespacedName = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXOpeningElement = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXSpreadAttribute = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXSpreadChild = function (node, opts) { return t.is(type, node, opts); }
n/a
isJSXText = function (node, opts) { return t.is(type, node, opts); }
n/a
isLVal = function (node, opts) { return t.is(type, node, opts); }
n/a
isLabeledStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
function isLet(node) { return t.isVariableDeclaration(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]); }
n/a
isLiteral = function (node, opts) { return t.is(type, node, opts); }
n/a
isLogicalExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isLoop = function (node, opts) { return t.is(type, node, opts); }
n/a
isMemberExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isMetaProperty = function (node, opts) { return t.is(type, node, opts); }
n/a
isMethod = function (node, opts) { return t.is(type, node, opts); }
...
fnPath.setData(key, id);
var classPath = fnPath.findParent(function (p) {
return p.isClass();
});
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor
" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
...
isMixedTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isModuleDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isModuleSpecifier = function (node, opts) { return t.is(type, node, opts); }
n/a
isNewExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
function isNode(node) { return !!(node && _definitions.VISITOR_KEYS[node.type]); }
n/a
function isNodesEquivalent(a, b) { if ((typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || (typeof a === "undefined" ? "undefined " : (0, _typeof3.default)(a)) !== "object" || a == null || b == null) { return a === b; } if (a.type !== b.type) { return false; } var fields = (0, _keys2.default)(t.NODE_FIELDS[a.type] || a.type); for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var field = _ref2; if ((0, _typeof3.default)(a[field]) !== (0, _typeof3.default)(b[field])) { return false; } if (Array.isArray(a[field])) { if (!Array.isArray(b[field])) { return false; } if (a[field].length !== b[field].length) { return false; } for (var i = 0; i < a[field].length; i++) { if (!isNodesEquivalent(a[field][i], b[field][i])) { return false; } } continue; } if (!isNodesEquivalent(a[field], b[field])) { return false; } } return true; }
n/a
isNoop = function (node, opts) { return t.is(type, node, opts); }
n/a
isNullLiteral = function (node, opts) { return t.is(type, node, opts); }
n/a
isNullLiteralTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isNullableTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isNumberLiteral = function () { console.trace("The node type " + _type + " has been renamed to " + newType); return fn.apply(this, arguments); }
n/a
isNumberTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isNumericLiteral = function (node, opts) { return t.is(type, node, opts); }
n/a
isNumericLiteralTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectMember = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectMethod = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectPattern = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectProperty = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectTypeCallProperty = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectTypeIndexer = function (node, opts) { return t.is(type, node, opts); }
n/a
isObjectTypeProperty = function (node, opts) { return t.is(type, node, opts); }
n/a
isParenthesizedExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isPattern = function (node, opts) { return t.is(type, node, opts); }
n/a
isProgram = function (node, opts) { return t.is(type, node, opts); }
...
var passedShadowFunction = false;
var fnPath = path.find(function (innerPath) {
if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value"
;) {
return true;
}
if (path === innerPath) return false;
if (innerPath.isProgram() || innerPath.isFunction()) {
currentFunction = currentFunction || innerPath;
}
if (innerPath.isProgram()) {
passedShadowFunction = true;
return true;
...
isProperty = function (node, opts) { return t.is(type, node, opts); }
n/a
isPureish = function (node, opts) { return t.is(type, node, opts); }
n/a
isQualifiedTypeIdentifier = function (node, opts) { return t.is(type, node, opts); }
n/a
function isReferenced(node, parent) { switch (parent.type) { case "BindExpression": return parent.object === node || parent.callee === node; case "MemberExpression": case "JSXMemberExpression": if (parent.property === node && parent.computed) { return true; } else if (parent.object === node) { return true; } else { return false; } case "MetaProperty": return false; case "ObjectProperty": if (parent.key === node) { return parent.computed; } case "VariableDeclarator": return parent.id !== node; case "ArrowFunctionExpression": case "FunctionDeclaration": case "FunctionExpression": for (var _iterator = parent.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var param = _ref; if (param === node) return false; } return parent.id !== node; case "ExportSpecifier": if (parent.source) { return false; } else { return parent.local === node; } case "ExportNamespaceSpecifier": case "ExportDefaultSpecifier": return false; case "JSXAttribute": return parent.name !== node; case "ClassProperty": if (parent.key === node) { return parent.computed; } else { return parent.value === node; } case "ImportDefaultSpecifier": case "ImportNamespaceSpecifier": case "ImportSpecifier": return false; case "ClassDeclaration": case "ClassExpression": return parent.id !== node; case "ClassMethod": case "ObjectMethod": return parent.key === node && parent.computed; case "LabeledStatement": return false; case "CatchClause": return parent.param !== node; case "RestElement": return false; case "AssignmentExpression": return parent.right === node; case "AssignmentPattern": return parent.right === node; case "ObjectPattern": case "ArrayPattern": return false; } return true; }
n/a
isRegExpLiteral = function (node, opts) { return t.is(type, node, opts); }
n/a
isRegexLiteral = function () { console.trace("The node type " + _type + " has been renamed to " + newType); return fn.apply(this, arguments); }
n/a
isRestElement = function (node, opts) { return t.is(type, node, opts); }
n/a
isRestProperty = function (node, opts) { return t.is(type, node, opts); }
n/a
isReturnStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isScopable = function (node, opts) { return t.is(type, node, opts); }
n/a
function isScope(node, parent) { if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) { return false; } return t.isScopable(node); }
n/a
isSequenceExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
function isSpecifierDefault(specifier) { return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: "default" }); }
n/a
isSpreadElement = function (node, opts) { return t.is(type, node, opts); }
n/a
isSpreadProperty = function (node, opts) { return t.is(type, node, opts); }
n/a
isStatement = function (node, opts) { return t.is(type, node, opts); }
...
var node = path.node;
var source = node.source ? node.source.value : null;
var exports = file.metadata.modules.exports;
var declar = path.get("declaration");
if (declar.isStatement()) {
var bindings = declar.getBindingIdentifiers();
for (var name in bindings) {
exports.exported.push(name);
exports.specifiers.push({
kind: "local",
local: name,
...
isStringLiteral = function (node, opts) { return t.is(type, node, opts); }
n/a
isStringLiteralTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isStringTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isSuper = function (node, opts) { return t.is(type, node, opts); }
...
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var SUPER_THIS_BOUND = (0, _symbol2.default)("super this bound");
var superVisitor = {
CallExpression: function CallExpression(path) {
if (!path.get("callee").isSuper()) return;
var node = path.node;
if (node[SUPER_THIS_BOUND]) return;
node[SUPER_THIS_BOUND] = true;
path.replaceWith(t.assignmentExpression("=", this.id, node));
...
isSwitchCase = function (node, opts) { return t.is(type, node, opts); }
n/a
isSwitchStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isTaggedTemplateExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isTemplateElement = function (node, opts) { return t.is(type, node, opts); }
n/a
isTemplateLiteral = function (node, opts) { return t.is(type, node, opts); }
n/a
isTerminatorless = function (node, opts) { return t.is(type, node, opts); }
n/a
isThisExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isThisTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isThrowStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isTryStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isTupleTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
function isType(nodeType, targetType) { if (nodeType === targetType) return true; if (t.ALIAS_KEYS[targetType]) return false; var aliases = t.FLIPPED_ALIAS_KEYS[targetType]; if (aliases) { if (aliases[0] === nodeType) return true; for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var alias = _ref; if (nodeType === alias) return true; } } return false; }
n/a
isTypeAlias = function (node, opts) { return t.is(type, node, opts); }
n/a
isTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isTypeCastExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isTypeParameter = function (node, opts) { return t.is(type, node, opts); }
n/a
isTypeParameterDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isTypeParameterInstantiation = function (node, opts) { return t.is(type, node, opts); }
n/a
isTypeofTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isUnaryExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isUnaryLike = function (node, opts) { return t.is(type, node, opts); }
n/a
isUnionTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isUpdateExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
isUserWhitespacable = function (node, opts) { return t.is(type, node, opts); }
n/a
function isValidIdentifier(name) { if (typeof name !== "string" || _esutils2.default.keyword.isReservedWordES6(name, true)) { return false; } else if (name === "await") { return false; } else { return _esutils2.default.keyword.isIdentifierNameES6(name); } }
n/a
function isVar(node) { return t.isVariableDeclaration(node, { kind: "var" }) && !node[_constants.BLOCK_SCOPED_SYMBOL]; }
n/a
isVariableDeclaration = function (node, opts) { return t.is(type, node, opts); }
n/a
isVariableDeclarator = function (node, opts) { return t.is(type, node, opts); }
n/a
isVoidTypeAnnotation = function (node, opts) { return t.is(type, node, opts); }
n/a
isWhile = function (node, opts) { return t.is(type, node, opts); }
n/a
isWhileStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isWithStatement = function (node, opts) { return t.is(type, node, opts); }
n/a
isYieldExpression = function (node, opts) { return t.is(type, node, opts); }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
numberLiteral = function () { console.trace("The node type " + _type + " has been renamed to " + newType); return fn.apply(this, arguments); }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function prependToMemberExpression(member, prepend) { member.object = t.memberExpression(prepend, member.object); return member; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
regexLiteral = function () { console.trace("The node type " + _type + " has been renamed to " + newType); return fn.apply(this, arguments); }
n/a
function removeComments(node) { for (var _iterator4 = t.COMMENT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0 , _getIterator3.default)(_iterator4);;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var key = _ref4; delete node[key]; } return node; }
n/a
function removeProperties(node, opts) { opts = opts || {}; var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; for (var _iterator9 = map, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3 .default)(_iterator9);;) { var _ref9; if (_isArray9) { if (_i9 >= _iterator9.length) break; _ref9 = _iterator9[_i9++]; } else { _i9 = _iterator9.next(); if (_i9.done) break; _ref9 = _i9.value; } var _key4 = _ref9; if (node[_key4] != null) node[_key4] = undefined; } for (var key in node) { if (key[0] === "_" && node[key] != null) node[key] = undefined; } var syms = (0, _getOwnPropertySymbols2.default)(node); for (var _iterator10 = syms, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3 .default)(_iterator10);;) { var _ref10; if (_isArray10) { if (_i10 >= _iterator10.length) break; _ref10 = _iterator10[_i10++]; } else { _i10 = _iterator10.next(); if (_i10.done) break; _ref10 = _i10.value; } var sym = _ref10; node[sym] = null; } }
n/a
function removePropertiesDeep(tree, opts) { traverseFast(tree, removeProperties, opts); return tree; }
n/a
function removeTypeDuplicates(nodes) { var generics = {}; var bases = {}; var typeGroups = []; var types = []; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (!node) continue; if (types.indexOf(node) >= 0) { continue; } if (t.isAnyTypeAnnotation(node)) { return [node]; } if (t.isFlowBaseAnnotation(node)) { bases[node.type] = node; continue; } if (t.isUnionTypeAnnotation(node)) { if (typeGroups.indexOf(node.types) < 0) { nodes = nodes.concat(node.types); typeGroups.push(node.types); } continue; } if (t.isGenericTypeAnnotation(node)) { var name = node.id.name; if (generics[name]) { var existing = generics[name]; if (existing.typeParameters) { if (node.typeParameters) { existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params )); } } else { existing = node.typeParameters; } } else { generics[name] = node; } continue; } types.push(node); } for (var type in bases) { types.push(bases[type]); } for (var _name in generics) { types.push(generics[_name]); } return types; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function shallowEqual(actual, expected) { var keys = (0, _keys2.default)(expected); for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3 .default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var key = _ref3; if (actual[key] !== expected[key]) { return false; } } return true; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
...
var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
fnPath.scope.push({ id: id });
fnPath.traverse(superVisitor, { id: id });
} else {
var init = key === "this" ? t.thisExpression() : t.identifier(key);
if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
fnPath.scope.push({ id: id, init: init });
}
return path.replaceWith(id);
...
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function toBindingIdentifierName(name) { name = toIdentifier(name); if (name === "eval" || name === "arguments") name = "_" + name; return name; }
n/a
function toBlock(node, parent) { if (t.isBlockStatement(node)) { return node; } if (t.isEmptyStatement(node)) { node = []; } if (!Array.isArray(node)) { if (!t.isStatement(node)) { if (t.isFunction(parent)) { node = t.returnStatement(node); } else { node = t.expressionStatement(node); } } node = [node]; } return t.blockStatement(node); }
n/a
function toComputedKey(node) { var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key || node.property; if (!node.computed) { if (t.isIdentifier(key)) key = t.stringLiteral(key.name); } return key; }
n/a
function toExpression(node) { if (t.isExpressionStatement(node)) { node = node.expression; } if (t.isExpression(node)) { return node; } if (t.isClass(node)) { node.type = "ClassExpression"; } else if (t.isFunction(node)) { node.type = "FunctionExpression"; } if (!t.isExpression(node)) { throw new Error("cannot turn " + node.type + " to an expression"); } return node; }
n/a
function toIdentifier(name) { name = name + ""; name = name.replace(/[^a-zA-Z0-9$_]/g, "-"); name = name.replace(/^[-0-9]+/, ""); name = name.replace(/[-\s]+(.)?/g, function (match, c) { return c ? c.toUpperCase() : ""; }); if (!t.isValidIdentifier(name)) { name = "_" + name; } return name || "_"; }
n/a
function toKeyAlias(node) { var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key; var alias = void 0; if (node.kind === "method") { return toKeyAlias.increment() + ""; } else if (t.isIdentifier(key)) { alias = key.name; } else if (t.isStringLiteral(key)) { alias = (0, _stringify2.default)(key.value); } else { alias = (0, _stringify2.default)(t.removePropertiesDeep(t.cloneDeep(key))); } if (node.computed) { alias = "[" + alias + "]"; } if (node.static) { alias = "static:" + alias; } return alias; }
n/a
function toSequenceExpression(nodes, scope) { if (!nodes || !nodes.length) return; var declars = []; var bailed = false; var result = convert(nodes); if (bailed) return; for (var i = 0; i < declars.length; i++) { scope.push(declars[i]); } return result; function convert(nodes) { var ensureLastUndefined = false; var exprs = []; for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var node = _ref; if (t.isExpression(node)) { exprs.push(node); } else if (t.isExpressionStatement(node)) { exprs.push(node.expression); } else if (t.isVariableDeclaration(node)) { if (node.kind !== "var") return bailed = true; for (var _iterator2 = node.declarations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var declar = _ref2; var bindings = t.getBindingIdentifiers(declar); for (var key in bindings) { declars.push({ kind: node.kind, id: bindings[key] }); } if (declar.init) { exprs.push(t.assignmentExpression("=", declar.id, declar.init)); } } ensureLastUndefined = true; continue; } else if (t.isIfStatement(node)) { var consequent = node.consequent ? convert([node.consequent]) : scope.buildUndefinedNode(); var alternate = node.alternate ? convert([node.alternate]) : scope.buildUndefinedNode(); if (!consequent || !alternate) return bailed = true; exprs.push(t.conditionalExpression(node.test, consequent, alternate)); } else if (t.isBlockStatement(node)) { exprs.push(convert(node.body)); } else if (t.isEmptyStatement(node)) { ensureLastUndefined = true; continue; } else { return bailed = true; } ensureLastUndefined = false; } if (ensureLastUndefined || exprs.length === 0) { exprs.push(scope.buildUndefinedNode()); } if (exprs.length === 1) { return exprs[0]; } else { return t.sequenceExpression(exprs); } } }
n/a
function toStatement(node, ignore) { if (t.isStatement(node)) { return node; } var mustHaveId = false; var newType = void 0; if (t.isClass(node)) { mustHaveId = true; newType = "ClassDeclaration"; } else if (t.isFunction(node)) { mustHaveId = true; newType = "FunctionDeclaration"; } else if (t.isAssignmentExpression(node)) { return t.expressionStatement(node); } if (mustHaveId && !node.id) { newType = false; } if (!newType) { if (ignore) { return false; } else { throw new Error("cannot turn " + node.type + " to a statement"); } } node.type = newType; return node; }
n/a
function traverseFast(node, enter, opts) { if (!node) return; var keys = t.VISITOR_KEYS[node.type]; if (!keys) return; opts = opts || {}; enter(node, opts); for (var _iterator7 = keys, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3 .default)(_iterator7);;) { var _ref7; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref7 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref7 = _i7.value; } var key = _ref7; var subNode = node[key]; if (Array.isArray(subNode)) { for (var _iterator8 = subNode, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3 .default)(_iterator8);;) { var _ref8; if (_isArray8) { if (_i8 >= _iterator8.length) break; _ref8 = _iterator8[_i8++]; } else { _i8 = _iterator8.next(); if (_i8.done) break; _ref8 = _i8.value; } var _node = _ref8; traverseFast(_node, enter, opts); } } else { traverseFast(subNode, enter, opts); } } }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function validate(node, key, val) { if (!node) return; var fields = t.NODE_FIELDS[node.type]; if (!fields) return; var field = fields[key]; if (!field || !field.validate) return; if (field.optional && val == null) return; field.validate(node, key, val); }
n/a
function valueToNode(value) { if (value === undefined) { return t.identifier("undefined"); } if (value === true || value === false) { return t.booleanLiteral(value); } if (value === null) { return t.nullLiteral(); } if (typeof value === "string") { return t.stringLiteral(value); } if (typeof value === "number") { return t.numericLiteral(value); } if ((0, _isRegExp2.default)(value)) { var pattern = value.source; var flags = value.toString().match(/\/([a-z]+|)$/)[1]; return t.regExpLiteral(pattern, flags); } if (Array.isArray(value)) { return t.arrayExpression(value.map(t.valueToNode)); } if ((0, _isPlainObject2.default)(value)) { var props = []; for (var key in value) { var nodeKey = void 0; if (t.isValidIdentifier(key)) { nodeKey = t.identifier(key); } else { nodeKey = t.stringLiteral(key); } props.push(t.objectProperty(nodeKey, t.valueToNode(value[key]))); } return t.objectExpression(props); } throw new Error("don't know how to turn this value into a node"); }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function builder() { if (arguments.length > keys.length) { throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length)); } var node = {}; node.type = type; var i = 0; for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; var field = t.NODE_FIELDS[type][_key]; var arg = arguments[i++]; if (arg === undefined) arg = (0, _clone2.default)(field.default); node[_key] = arg; } for (var key in node) { validate(node, key, node[key]); } return node; }
n/a
function buildChildren(node) { var elems = []; for (var i = 0; i < node.children.length; i++) { var child = node.children[i]; if (t.isJSXText(child)) { cleanJSXElementLiteralChild(child, elems); continue; } if (t.isJSXExpressionContainer(child)) child = child.expression; if (t.isJSXEmptyExpression(child)) continue; elems.push(child); } return elems; }
n/a
function isCompatTag(tagName) { return !!tagName && /^[a-z]|\-/.test(tagName); }
n/a
isReactComponent = function (member) { if (!t.isMemberExpression(member)) return false; var search = [member]; var i = 0; while (search.length) { var node = search.shift(); if (allowPartial && i === parts.length) { return true; } if (t.isIdentifier(node)) { if (parts[i] !== node.name) return false; } else if (t.isStringLiteral(node)) { if (parts[i] !== node.value) return false; } else if (t.isMemberExpression(node)) { if (node.computed && !t.isStringLiteral(node.property)) { return false; } else { search.push(node.object); search.push(node.property); continue; } } else { return false; } if (++i > parts.length) { return false; } } return true; }
n/a
function toKeyAlias(node) { var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key; var alias = void 0; if (node.kind === "method") { return toKeyAlias.increment() + ""; } else if (t.isIdentifier(key)) { alias = key.name; } else if (t.isStringLiteral(key)) { alias = (0, _stringify2.default)(key.value); } else { alias = (0, _stringify2.default)(t.removePropertiesDeep(t.cloneDeep(key))); } if (node.computed) { alias = "[" + alias + "]"; } if (node.static) { alias = "static:" + alias; } return alias; }
n/a
increment = function () { if (toKeyAlias.uid >= _maxSafeInteger2.default) { return toKeyAlias.uid = 0; } else { return toKeyAlias.uid++; } }
n/a
function arrayify(val, mapFn) { if (!val) return []; if (typeof val === "boolean") return arrayify([val], mapFn); if (typeof val === "string") return arrayify(list(val), mapFn); if (Array.isArray(val)) { if (mapFn) val = val.map(mapFn); return val; } return [val]; }
n/a
function booleanify(val) { if (val === "true" || val == 1) { return true; } if (val === "false" || val == 0 || !val) { return false; } return val; }
n/a
function canCompile(filename, altExts) { var exts = altExts || canCompile.EXTENSIONS; var ext = _path2.default.extname(filename); return (0, _includes2.default)(exts, ext); }
n/a
inherits = function (ctor, superCtor) { if (ctor === undefined || ctor === null) throw new TypeError('The constructor to "inherits" must not be ' + 'null or undefined'); if (superCtor === undefined || superCtor === null) throw new TypeError('The super constructor to "inherits" must not ' + 'be null or undefined'); if (superCtor.prototype === undefined) throw new TypeError('The super constructor to "inherits" must ' + 'have a prototype'); ctor.super_ = superCtor; Object.setPrototypeOf(ctor.prototype, superCtor.prototype); }
n/a
function inspect(obj, opts) { // default options var ctx = { seen: [], stylize: stylizeNoColor }; // legacy... if (arguments.length >= 3 && arguments[2] !== undefined) { ctx.depth = arguments[2]; } if (arguments.length >= 4 && arguments[3] !== undefined) { ctx.colors = arguments[3]; } if (typeof opts === 'boolean') { // legacy... ctx.showHidden = opts; } // Set default and user-specified options ctx = Object.assign({}, inspect.defaultOptions, ctx, opts); if (ctx.colors) ctx.stylize = stylizeWithColor; if (ctx.maxArrayLength === null) ctx.maxArrayLength = Infinity; return formatValue(ctx, obj, ctx.depth); }
n/a
function list(val) { if (!val) { return []; } else if (Array.isArray(val)) { return val; } else if (typeof val === "string") { return val.split(","); } else { return [val]; } }
n/a
function regexify(val) { if (!val) { return new RegExp(/.^/); } if (Array.isArray(val)) { val = new RegExp(val.map(_escapeRegExp2.default).join("|"), "i"); } if (typeof val === "string") { val = (0, _slash2.default)(val); if ((0, _startsWith2.default)(val, "./") || (0, _startsWith2.default)(val, "*/")) val = val.slice(2); if ((0, _startsWith2.default)(val, "**/")) val = val.slice(3); var regex = _minimatch2.default.makeRe(val, { nocase: true }); return new RegExp(regex.source.slice(1, -1), "i"); } if ((0, _isRegExp2.default)(val)) { return val; } throw new TypeError("illegal type for regexify"); }
n/a
function shouldIgnore(filename) { var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var only = arguments[2]; filename = filename.replace(/\\/g, "/"); if (only) { for (var _iterator = only, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3 .default)(_iterator);;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var pattern = _ref; if (_shouldIgnore(pattern, filename)) return false; } return true; } else if (ignore.length) { for (var _iterator2 = ignore, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3 .default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _pattern = _ref2; if (_shouldIgnore(_pattern, filename)) return true; } } return false; }
n/a