Skip to content

Commit b062926

Browse files
fix: Support xmldom 0.9.0+ (#425)
1 parent 92db81b commit b062926

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/storage-client/googleapis.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
CPU,
1111
APPLE_ARM_SUFFIXES,
1212
} from '../constants';
13-
import {DOMParser} from '@xmldom/xmldom';
14-
import path from 'path';
13+
import {DOMParser, MIME_TYPE} from '@xmldom/xmldom';
14+
import path from 'node:path';
1515

1616

1717
const log = logger.getLogger('ChromedriverGoogleapisStorageClient');
@@ -95,7 +95,7 @@ export function parseNotes(content) {
9595
* @returns {Promise<ChromedriverDetailsMapping>}
9696
*/
9797
export async function parseGoogleapiStorageXml(xml, shouldParseNotes = true) {
98-
const doc = new DOMParser().parseFromString(xml);
98+
const doc = new DOMParser().parseFromString(xml, MIME_TYPE?.XML_TEXT ?? 'text/xml');
9999
const driverNodes = /** @type {Array<Node|Attr>} */ (
100100
xpath.select(`//*[local-name(.)='Contents']`, doc)
101101
);

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"types": ["node"],
66
"outDir": "build",
77
"checkJs": true,
8+
"esModuleInterop": true,
89
"lib": ["es2020", "dom"]
910
},
1011
"include": ["lib"]

0 commit comments

Comments
 (0)