Skip to content

Commit

Permalink
fix: Support xmldom 0.9.0+ (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Aug 31, 2024
1 parent 92db81b commit b062926
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/storage-client/googleapis.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
CPU,
APPLE_ARM_SUFFIXES,
} from '../constants';
import {DOMParser} from '@xmldom/xmldom';
import path from 'path';
import {DOMParser, MIME_TYPE} from '@xmldom/xmldom';
import path from 'node:path';


const log = logger.getLogger('ChromedriverGoogleapisStorageClient');
Expand Down Expand Up @@ -95,7 +95,7 @@ export function parseNotes(content) {
* @returns {Promise<ChromedriverDetailsMapping>}
*/
export async function parseGoogleapiStorageXml(xml, shouldParseNotes = true) {
const doc = new DOMParser().parseFromString(xml);
const doc = new DOMParser().parseFromString(xml, MIME_TYPE?.XML_TEXT ?? 'text/xml');
const driverNodes = /** @type {Array<Node|Attr>} */ (
xpath.select(`//*[local-name(.)='Contents']`, doc)
);
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"types": ["node"],
"outDir": "build",
"checkJs": true,
"esModuleInterop": true,
"lib": ["es2020", "dom"]
},
"include": ["lib"]
Expand Down

0 comments on commit b062926

Please sign in to comment.