first commit

This commit is contained in:
2025-10-26 23:10:15 +08:00
commit 8f0345b7be
14961 changed files with 2356381 additions and 0 deletions

32
node_modules/@n8n/node-cli/dist/utils/ast.js generated vendored Normal file
View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getChildObjectLiteral = exports.updateStringProperty = exports.loadSingleSourceFile = void 0;
const ts_morph_1 = require("ts-morph");
const loadSingleSourceFile = (path) => {
const project = new ts_morph_1.Project({
skipFileDependencyResolution: true,
});
return project.addSourceFileAtPath(path);
};
exports.loadSingleSourceFile = loadSingleSourceFile;
const setStringInitializer = (prop, value) => {
prop.getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.StringLiteral).setLiteralValue(value);
};
const updateStringProperty = ({ obj, key, value, }) => {
const prop = obj.getPropertyOrThrow(key);
if (prop.isKind(ts_morph_1.SyntaxKind.PropertyAssignment)) {
setStringInitializer(prop.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyAssignment), value);
}
else if (prop.isKind(ts_morph_1.SyntaxKind.PropertyDeclaration)) {
setStringInitializer(prop.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyDeclaration), value);
}
};
exports.updateStringProperty = updateStringProperty;
const getChildObjectLiteral = ({ obj, key, }) => {
return obj
.getPropertyOrThrow(key)
.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyAssignment)
.getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
};
exports.getChildObjectLiteral = getChildObjectLiteral;
//# sourceMappingURL=ast.js.map