@rxap/schematics-ts-morph
Version:
This package provides utilities for manipulating TypeScript code using ts-morph, particularly for Angular and NestJS projects. It offers functions to add, coerce, and modify code elements like classes, methods, decorators, and imports. The package also in
14 lines • 721 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsArrayLiteralExpression = IsArrayLiteralExpression;
exports.AssertArrayLiteralExpression = AssertArrayLiteralExpression;
const ts_morph_1 = require("ts-morph");
function IsArrayLiteralExpression(expression) {
return !!(expression === null || expression === void 0 ? void 0 : expression.isKind(ts_morph_1.SyntaxKind.ArrayLiteralExpression));
}
function AssertArrayLiteralExpression(expression, variableDeclarationName) {
if (!IsArrayLiteralExpression(expression)) {
throw new Error(`The variable declaration '${variableDeclarationName}' is not an array!`);
}
}
//# sourceMappingURL=is-array-literal-expression.js.map