Files
SnowLuma/.pnpm-store/v11/files/12/a257b8e1cd4a66baa9b0d70313156e62e862377054d33898aefe203c977f470c2b3d8d322ce01418bb36a1ddd8f7f267622af612644eae41acc364cecc6324
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

49 lines
1.1 KiB
Plaintext

"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