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

Add YAML std module #3361

Merged
merged 5 commits into from
Nov 18, 2019
Merged

Add YAML std module #3361

merged 5 commits into from
Nov 18, 2019

Conversation

lsagetlethias
Copy link
Contributor

Setup YAML module as it was made in denoland/std#528.

This a a port from nodeca/js-yaml.

Typing internally is quite messy but the endpoints themselves (parse and stringify) are ready to use.

deno fmt is ok
deno test is ok

Additional tests from original repo's old issues are not usable as they mainly use third party library not yet ported in deno.
Like in this test: https://github.com/nodeca/js-yaml/blob/665aadda42349dcae869f12040d9b10ef18d12da/test/25-dumper-fuzzy.js#L4 where the fast-check lib is used.

@CLAassistant
Copy link

CLAassistant commented Nov 17, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

It's a lot of code, but I guess YAML is just a wildly complicated specification.

It's nice you've ported this all to TypeScript! Thanks - this is great to have!

@ry ry merged commit 5671d38 into denoland:master Nov 18, 2019
@tunnckoCore
Copy link

tunnckoCore commented Nov 26, 2019

Any thoughts/reasons why js-yaml instead of https://www.npmjs.com/package/yaml? I'm still not sure myself which one to use when I need it, but at least the API is more sane .parse and .stringify.

@lsagetlethias
Copy link
Contributor Author

Well ; in term of date of creation, number of stars, stability, and number of download per weeks, js-yaml is way before any other yaml lib https://www.npmtrends.com/js-yaml-vs-yaml

@tunnckoCore
Copy link

Yea, I know, was just wondering.

Okay, then wouldn't it better to expose different (and I think more intuitive) API and don't inherit it from js-yaml, since Deno is still in early stages.

@lsagetlethias
Copy link
Contributor Author

That's what I've done:

export * from "./yaml/parse.ts";

Both endpoint types are available. Including classical parse / stringify standard combo ☺️

bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Dec 28, 2019
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 21, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Feb 1, 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.

4 participants