Skip to content

Commit df31967

Browse files
committed
fixup! refactor: modernize array and string last element access using .at(-1)
1 parent 62988b0 commit df31967

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular_devkit/core/src/utils/template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function templateWithSourceMap(ast: TemplateAst, options?: TemplateOptions): str
253253
]),
254254
);
255255

256-
const end = ast.children.length ? ast.children.at(-1)?.end : { line: 0, column: 0 };
256+
const end = ast.children.at(-1)?.end ?? { line: 0, column: 0 };
257257
const nodes = ast.children
258258
.reduce((chunk, node) => {
259259
let code: string | SourceNode | (SourceNode | string)[] = '';

0 commit comments

Comments
 (0)