File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 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.
44
55## unreleased
66
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.
710* Build
811 * Use _ webpack_ ` v5.90.3 ` now, was ` v5.89.0 ` (via [ #1008 ] , [ #1013 ] , [ #1015 ] )
912
1013[ #1008 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1008
1114[ #1013 ] : https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1013
1215[ #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+
1319
1420## 6.3.1 -- 2023-12-11
1521
Original file line number Diff line number Diff line change @@ -17,23 +17,30 @@ SPDX-License-Identifier: Apache-2.0
1717Copyright (c) OWASP Foundation. All Rights Reserved.
1818*/
1919
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+ */
2027const possibleStringifiers = [
21- // prioritized list of possible implementations
22- 'xmlbuilder2'
28+ [ 'xmlbuilder2' , ( ) => require ( './stringifiers/xmlbuilder2' ) ]
2329]
30+ /* eslint-enable jsdoc/valid-types */
2431
2532module . exports . stringify = function ( ) {
2633 throw new Error (
2734 'No stringifier available.' +
2835 ' Please install any of the optional dependencies: ' +
29- possibleStringifiers . join ( ', ' )
36+ possibleStringifiers . map ( kv => kv [ 0 ] ) . join ( ', ' )
3037 )
3138}
3239module . exports . stringify . fails = true
3340
34- for ( const file of possibleStringifiers ) {
41+ for ( const [ , getStringifier ] of possibleStringifiers ) {
3542 try {
36- const possibleStringifier = require ( `./stringifiers/ ${ file } ` )
43+ const possibleStringifier = getStringifier ( )
3744 if ( typeof possibleStringifier === 'function' ) {
3845 module . exports . stringify = possibleStringifier
3946 break
You can’t perform that action at this time.
0 commit comments