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

fix(encoding/yaml): fix parseAll type definition by using overloads #1048

Merged
merged 2 commits into from
Jul 21, 2021

Conversation

FujiHaruka
Copy link
Contributor

fix #679

This fixes type definition of parseAll in yaml module.

Current:

// ok
parseAll(yaml)
// ok
parseAll(yaml, callback)
// ok
parseAll(yaml, callback, options)
// typing is ok, but options are ignored
parseAll(yaml, undefined, options)
// type error, but options are accepted
parseAll(yaml, options)

Modified:

// ok
parseAll(yaml)
// ok
parseAll(yaml, callback)
// ok
parseAll(yaml, callback, options)
// type error
parseAll(yaml, undefined, options)
// ok
parseAll(yaml, options)

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FujiHaruka LGTM. Thanks!

@kt3k kt3k merged commit f12982d into denoland:main Jul 21, 2021
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

Successfully merging this pull request may close these issues.

[bug] yaml types -- ignores schema
2 participants