From b238ebdea29a19cba04e8f938354d08762757f32 Mon Sep 17 00:00:00 2001 From: Ryan Grove Date: Mon, 17 Oct 2022 13:54:18 -0700 Subject: [PATCH] Make the options argument actually optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. 🤦‍♂️ --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 50603ae..4bf0216 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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; }