Skip to content

TypeError: options.warning is not a function #22

New issue

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

Closed
bitGatito opened this issue Jul 1, 2023 · 1 comment
Closed

TypeError: options.warning is not a function #22

bitGatito opened this issue Jul 1, 2023 · 1 comment

Comments

@bitGatito
Copy link

bitGatito commented Jul 1, 2023

Using the package as: const schema = parse('x-whatevertag', {warning: true}), results in error:

     if (options.warning) options.warning(reason, code, offset)
                                 ^
TypeError: options.warning is not a function
     at fail (file:///C:/Users/.../node_modules/bcp-47/lib/parse.js:288:34)
     at parse (file:///C:/Users/.../node_modules/bcp-47/lib/parse.js:258:18)
    at file:///C:/Users/.../src/test.js:3:16```
@wooorm
Copy link
Owner

wooorm commented Jul 1, 2023

Hi! You use TypeScript. TypeScript tells you that you pass wrong input. That’s why TypeScript exists. Please use the types provided or read the docs: https://github.com/wooorm/bcp-47#optionswarning

@wooorm wooorm closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants