Skip to content

Commit db3ca18

Browse files
committed
fix: iri-escape double-quot
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent bdbe727 commit db3ca18

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ All notable changes to this project will be documented in this file.
66

77
<!-- add unreleased items here -->
88

9+
* Fixed
10+
* url-encode double-quote in urls. ([#1154] via [#])
911
* Build
1012
* Use _TypeScript_ `v5.6.2` now, was `v5.5.3` (via [#1130]. [#1144])
1113
* Use _webpack_ `v5.95.0` now, was `v5.93.0` (via [#1138], [#1147])
@@ -14,6 +16,8 @@ All notable changes to this project will be documented in this file.
1416
[#1138]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1138
1517
[#1144]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1144
1618
[#1147]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1147
19+
[#1154]: https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1154
20+
[#]:
1721

1822
## 6.11.0 -- 2024-07-15
1923

examples/node/javascript/example.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ bom.metadata.component = new CDX.Models.Component(
3131
'MyProject'
3232
)
3333
bom.metadata.component.licenses.add(lFac.makeFromString('MIT OR Apache-2.0'))
34+
bom.metadata.component.
3435

3536
const componentA = new CDX.Models.Component(
3637
CDX.Enums.ComponentType.Library,

src/_helpers/uri.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ const _ESCAPES: Array<[RegExp, string]> = [
2424
[/</g, '%3C'],
2525
[/>/g, '%3E'],
2626
[/\{/g, '%7B'],
27-
[/}/g, '%7D']
27+
[/}/g, '%7D'],
28+
[/"/, '%%22']
2829
]
2930

3031
/**
@@ -34,10 +35,10 @@ const _ESCAPES: Array<[RegExp, string]> = [
3435
*
3536
* BEST EFFORT IMPLEMENTATION
3637
*
37-
* @see http://www.w3.org/TR/xmlschema-2/#anyURI
38-
* @see http://www.datypic.com/sc/xsd/t-xsd_anyURI.html
39-
* @see https://datatracker.ietf.org/doc/html/rfc2396
40-
* @see https://datatracker.ietf.org/doc/html/rfc3987
38+
* @see {@kink http://www.w3.org/TR/xmlschema-2/#anyURI}
39+
* @see {@kink http://www.datypic.com/sc/xsd/t-xsd_anyURI.html}
40+
* @see {@kink https://datatracker.ietf.org/doc/html/rfc2396}
41+
* @see {@kink https://datatracker.ietf.org/doc/html/rfc3987}
4142
*/
4243
export function escapeUri<T extends (string | undefined)> (value: T): T {
4344
if (value === undefined) {

0 commit comments

Comments
 (0)