Skip to content

Commit

Permalink
More descriptive comments and readability changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Shim committed Oct 18, 2024
1 parent e7e43d6 commit 7d3fb75
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/angular/build/src/utils/index-file/auto-csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ export async function autoCsp(html: string): Promise<string> {
}
}
// We are encountering the first start tag that's not <script src="..."> after a string of
// consecutive <script src="...">. The first place when we can determine this to be the case is
// consecutive <script src="...">. <script> tags without a src attribute will also end a chain
// of src attributes that can be loaded in a single loader script, so those will end up here.
//
// The first place when we can determine this to be the case is
// during the first opening tag that's not <script src="...">, where we need to insert the
// dynamic loader script before continuing on with writing the rest of the tags.
// (One edge case is where there are no more opening tags after the last <script src="..."> is
Expand Down Expand Up @@ -280,7 +283,7 @@ function createLoaderScript(srcList: SrcScriptTag[], enableTrustedTypes = false)
const srcListFormatted = srcList
.map(
(s) =>
`['${encodeURI(s.src).replaceAll("'", "\\'")}', ${s.type ? "'" + encodeURI(s.type) + "'" : undefined}, ${s.async ? 'true' : 'false'}, ${s.defer ? 'true' : 'false'}]`,
`['${encodeURI(s.src).replaceAll("'", "\\'")}', ${s.type ? "'" + s.type + "'" : undefined}, ${s.async ? 'true' : 'false'}, ${s.defer ? 'true' : 'false'}]`,

Check failure on line 286 in packages/angular/build/src/utils/index-file/auto-csp.ts

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 163. Maximum allowed is 140
)
.join();
return enableTrustedTypes

Check failure on line 289 in packages/angular/build/src/utils/index-file/auto-csp.ts

View workflow job for this annotation

GitHub Actions / lint

Expected blank line before this statement
Expand Down

0 comments on commit 7d3fb75

Please sign in to comment.