File tree 2 files changed +18
-5
lines changed
2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,18 @@ All notable changes to this project will be documented in this file.
4
4
5
5
## unreleased
6
6
7
+ * Refactor
8
+ * Removed dynamic imports in _ Node.js_ -specific XML serializer lookup ([ #1017 ] via [ #1018 ] )
9
+ This should improve compatibility with linkers and bundlers.
7
10
* Build
8
11
* Use _ webpack_ ` v5.90.3 ` now, was ` v5.89.0 ` (via [ #1008 ] , [ #1013 ] , [ #1015 ] )
9
12
10
13
[ #1008 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1008
11
14
[ #1013 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1013
12
15
[ #1015 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1015
16
+ [ #1017 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1017
17
+ [ #1018 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1018
18
+
13
19
14
20
## 6.3.1 -- 2023-12-11
15
21
Original file line number Diff line number Diff line change @@ -17,23 +17,30 @@ SPDX-License-Identifier: Apache-2.0
17
17
Copyright (c) OWASP Foundation. All Rights Reserved.
18
18
*/
19
19
20
+ /* eslint-disable jsdoc/valid-types --
21
+ JSDoc is still missing support for tuples - https://github.com/jsdoc/jsdoc/issues/1703
22
+ */
23
+ /**
24
+ * Prioritized list of possible implementations.
25
+ * @type {[string, function():(Function|*)][] }
26
+ */
20
27
const possibleStringifiers = [
21
- // prioritized list of possible implementations
22
- 'xmlbuilder2'
28
+ [ 'xmlbuilder2' , ( ) => require ( './stringifiers/xmlbuilder2' ) ]
23
29
]
30
+ /* eslint-enable jsdoc/valid-types */
24
31
25
32
module . exports . stringify = function ( ) {
26
33
throw new Error (
27
34
'No stringifier available.' +
28
35
' Please install any of the optional dependencies: ' +
29
- possibleStringifiers . join ( ', ' )
36
+ possibleStringifiers . map ( kv => kv [ 0 ] ) . join ( ', ' )
30
37
)
31
38
}
32
39
module . exports . stringify . fails = true
33
40
34
- for ( const file of possibleStringifiers ) {
41
+ for ( const [ , getStringifier ] of possibleStringifiers ) {
35
42
try {
36
- const possibleStringifier = require ( `./stringifiers/ ${ file } ` )
43
+ const possibleStringifier = getStringifier ( )
37
44
if ( typeof possibleStringifier === 'function' ) {
38
45
module . exports . stringify = possibleStringifier
39
46
break
You can’t perform that action at this time.
0 commit comments