Sha256: 6790244265636511a227992e7dab908dad0a1029ff9a1503cd009e7fced08178

Contents?: true

Size: 1.13 KB

Versions: 106

Compression:

Stored size: 1.13 KB

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = getAssignmentIdentifiers;
function getAssignmentIdentifiers(node) {
  const search = [].concat(node);
  const ids = Object.create(null);
  while (search.length) {
    const id = search.pop();
    if (!id) continue;
    switch (id.type) {
      case "ArrayPattern":
        search.push(...id.elements);
        break;
      case "AssignmentExpression":
      case "AssignmentPattern":
      case "ForInStatement":
      case "ForOfStatement":
        search.push(id.left);
        break;
      case "ObjectPattern":
        search.push(...id.properties);
        break;
      case "ObjectProperty":
        search.push(id.value);
        break;
      case "RestElement":
      case "UpdateExpression":
        search.push(id.argument);
        break;
      case "UnaryExpression":
        if (id.operator === "delete") {
          search.push(id.argument);
        }
        break;
      case "Identifier":
        ids[id.name] = id;
        break;
      default:
        break;
    }
  }
  return ids;
}

//# sourceMappingURL=getAssignmentIdentifiers.js.map

Version data entries

106 entries across 7 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/@babel/preset-modules/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-replace-supers/node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-function-name/node_modules/@babel/traverse/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-react-jsx/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/traverse/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-classes/node_modules/@babel/traverse/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-async-generator-functions/node_modules/@babel/traverse/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-computed-properties/node_modules/@babel/template/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-replace-supers/node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-replace-supers/node_modules/@babel/traverse/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/helper-wrap-function/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/traverse/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/helpers/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.51 node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/node_modules/@babel/traverse/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.50 node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/traverse/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.50 node_modules/@babel/helper-wrap-function/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.50 node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js
immosquare-cleaner-0.1.50 node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js