We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create
The function param overloading is confusing, and broken.
If you make a typo in the argument to builderOptions, then it will use defaults.
builderOptions
Validation should be added and overloading should be removed.
export function convert(p1: XMLBuilderCreateOptions | string | ExpandObject, p2?: string | ExpandObject | WriterOptions, p3?: WriterOptions): XMLSerializedValue { let builderOptions: XMLBuilderCreateOptions let contents: string | ExpandObject let convertOptions: WriterOptions | undefined if (isXMLBuilderCreateOptions(p1) && p2 !== undefined) { builderOptions = p1 contents = p2 convertOptions = p3 } else { builderOptions = DefaultBuilderOptions contents = p1 convertOptions = p2 as WriterOptions || undefined } return create(builderOptions, contents).end(convertOptions as any) }
function isXMLBuilderCreateOptions(obj: any): obj is XMLBuilderCreateOptions { if (!isPlainObject(obj)) return false for (const key in obj) { /* istanbul ignore else */ if (obj.hasOwnProperty(key)) { if (!XMLBuilderOptionKeys.has(key)) return false } } return true }
The text was updated successfully, but these errors were encountered:
oozcitak
No branches or pull requests
The function param overloading is confusing, and broken.
If you make a typo in the argument to
builderOptions
, then it will use defaults.Validation should be added and overloading should be removed.
The text was updated successfully, but these errors were encountered: