Skip to content

Commit

Permalink
Make the options argument actually optional
Browse files Browse the repository at this point in the history
Fixes #23

Unfortunately this bug snuck through because the unit tests themselves
aren't yet written in TypeScript, so the test for `parseXml()` without
an `options` argument happily passed despite the type definition being
incorrect. 🤦‍♂️
  • Loading branch information
rgrove committed Oct 17, 2022
1 parent 1946e02 commit b238ebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export type { ParserOptions } from './lib/Parser.js';
* @param xml XML string to parse.
* @param options Parser options.
*/
export function parseXml(xml: string, options: ParserOptions) {
export function parseXml(xml: string, options?: ParserOptions) {
return (new Parser(xml, options)).document;
}

0 comments on commit b238ebd

Please sign in to comment.