Skip to content
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

need the param str in isJSON method need to judge is undefined #28

Closed
chaoningx opened this issue Aug 30, 2021 · 0 comments
Closed

need the param str in isJSON method need to judge is undefined #28

chaoningx opened this issue Aug 30, 2021 · 0 comments

Comments

@chaoningx
Copy link

in the src/index file has a method called isJSON

const isJSON = str => str.startsWith('{')

there is cause a problem when the param str is undefined

so, i modify it as below, it work

const isJSON = str => str ? str.startsWith('{') : false

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

1 participant