diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-08-30 17:21:18 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-08-30 17:21:18 +0800 |
| commit | efbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch) | |
| tree | 2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/babel-helper-is-nodes-equiv | |
| parent | 43acceb75957c880a5ba5a31aae221394a36d5f6 (diff) | |
node fixes, updates
Diffstat (limited to 'node_modules/babel-helper-is-nodes-equiv')
4 files changed, 95 insertions, 0 deletions
diff --git a/node_modules/babel-helper-is-nodes-equiv/.npmignore b/node_modules/babel-helper-is-nodes-equiv/.npmignore new file mode 100644 index 00000000..22250660 --- /dev/null +++ b/node_modules/babel-helper-is-nodes-equiv/.npmignore @@ -0,0 +1,4 @@ +src +__tests__ +node_modules +*.log diff --git a/node_modules/babel-helper-is-nodes-equiv/README.md b/node_modules/babel-helper-is-nodes-equiv/README.md new file mode 100644 index 00000000..77dd1cf7 --- /dev/null +++ b/node_modules/babel-helper-is-nodes-equiv/README.md @@ -0,0 +1,7 @@ +# babel-helper-is-nodes-equiv + +## Installation + +```sh +$ npm install babel-helper-is-nodes-equiv +``` diff --git a/node_modules/babel-helper-is-nodes-equiv/lib/index.js b/node_modules/babel-helper-is-nodes-equiv/lib/index.js new file mode 100644 index 00000000..92b9b971 --- /dev/null +++ b/node_modules/babel-helper-is-nodes-equiv/lib/index.js @@ -0,0 +1,68 @@ +"use strict"; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; + +module.exports = function (t) { + function equiv(a, b) { + if ((typeof a === "undefined" ? "undefined" : _typeof(a)) !== "object" || (typeof a === "undefined" ? "undefined" : _typeof(a)) !== "object" || a == null || b == null) { + return a === b; + } + + if (a.type !== b.type) { + return false; + } + + var fields = Object.keys(t.NODE_FIELDS[a.type]); + + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var field = _step.value; + + if (_typeof(a[field]) !== _typeof(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 (!equiv(a[field][i], b[field][i])) { + return false; + } + } + continue; + } + + if (!equiv(a[field], b[field])) { + return false; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return true; + } + + return equiv; +};
\ No newline at end of file diff --git a/node_modules/babel-helper-is-nodes-equiv/package.json b/node_modules/babel-helper-is-nodes-equiv/package.json new file mode 100644 index 00000000..92d59ae6 --- /dev/null +++ b/node_modules/babel-helper-is-nodes-equiv/package.json @@ -0,0 +1,16 @@ +{ + "name": "babel-helper-is-nodes-equiv", + "version": "0.0.1", + "description": "", + "homepage": "https://github.com/babel/babili#readme", + "repository": "https://github.com/babel/babili/tree/master/packages/babel-helper-is-nodes-equiv", + "bugs": "https://github.com/babel/babili/issues", + "author": "amasad", + "license": "MIT", + "main": "lib/index.js", + "keywords": [ + "babel-plugin" + ], + "dependencies": {}, + "devDependencies": {} +} |
