diff options
| author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
| commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
| tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/esrecurse/esrecurse.js | |
| parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) | |
update packages
Diffstat (limited to 'node_modules/esrecurse/esrecurse.js')
| -rw-r--r-- | node_modules/esrecurse/esrecurse.js | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/node_modules/esrecurse/esrecurse.js b/node_modules/esrecurse/esrecurse.js index 0805e67f3..15d57dfd0 100644 --- a/node_modules/esrecurse/esrecurse.js +++ b/node_modules/esrecurse/esrecurse.js @@ -24,25 +24,7 @@ (function () { 'use strict'; - var assign, - estraverse, - isArray, - objectKeys; - - assign = require('object-assign'); - estraverse = require('estraverse'); - - isArray = Array.isArray || function isArray(array) { - return Object.prototype.toString.call(array) === '[object Array]'; - }; - - objectKeys = Object.keys || function (o) { - var keys = [], key; - for (key in o) { - keys.push(key); - } - return keys; - }; + var estraverse = require('estraverse'); function isNode(node) { if (node == null) { @@ -60,10 +42,10 @@ this.__visitor = visitor || this; this.__childVisitorKeys = options.childVisitorKeys - ? assign({}, estraverse.VisitorKeys, options.childVisitorKeys) + ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys) : estraverse.VisitorKeys; if (options.fallback === 'iteration') { - this.__fallback = objectKeys; + this.__fallback = Object.keys; } else if (typeof options.fallback === 'function') { this.__fallback = options.fallback; } @@ -94,7 +76,7 @@ for (i = 0, iz = children.length; i < iz; ++i) { child = node[children[i]]; if (child) { - if (isArray(child)) { + if (Array.isArray(child)) { for (j = 0, jz = child.length; j < jz; ++j) { if (child[j]) { if (isNode(child[j]) || isProperty(type, children[i])) { |
