Skip to content

Commit

Permalink
fix(stencil): Resolve exception when adding Angular output target (#1065
Browse files Browse the repository at this point in the history
)
  • Loading branch information
santhoshdasari786 authored and DominikPieper committed Feb 25, 2024
1 parent 1a96212 commit 7bdebeb
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/stencil/src/stencil-core-utils/lib/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ function addCodeIntoArray(
): StringChange[] {
const nodes = findNodes(source, ts.SyntaxKind.ObjectLiteralExpression);
let node = nodes[0];
const matchingProperties: ts.ObjectLiteralElement[] = node && (
node as ts.ObjectLiteralExpression
).properties
.filter(
(prop: ts.ObjectLiteralElementLike) =>
prop.kind == ts.SyntaxKind.PropertyAssignment
)
.filter((prop: ts.PropertyAssignment) => {
if (prop.name.kind === ts.SyntaxKind.Identifier) {
return (prop.name as ts.Identifier).getText(source) == identifier;
}
const matchingProperties: ts.ObjectLiteralElement[] =
node &&
(node as ts.ObjectLiteralExpression).properties
.filter(
(prop: ts.ObjectLiteralElementLike) =>
prop.kind == ts.SyntaxKind.PropertyAssignment
)
.filter((prop: ts.PropertyAssignment) => {
if (prop.name.kind === ts.SyntaxKind.Identifier) {
return (prop.name as ts.Identifier).getText(source) == identifier;
}

return false;
});
return false;
});

if (!matchingProperties) {
return [];
Expand Down

0 comments on commit 7bdebeb

Please sign in to comment.