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

Primitive serialization issue #143

Open
bali182 opened this issue Apr 14, 2022 · 0 comments
Open

Primitive serialization issue #143

bali182 opened this issue Apr 14, 2022 · 0 comments

Comments

@bali182
Copy link

bali182 commented Apr 14, 2022

I was testing the library with random data. As far as I understand, similarly to JSON, YAML is capable of serializing and deserializing primitives (string, number, boolean). This doesn't always seem to be the case. Please see example below:

import YAML from 'yamljs'

describe('YAML', () => {
  it('should be equal to the input', () => {
    const str = '0xn5t'
    expect(YAML.parse(YAML.stringify(str))).toBe(str)
  })
})

Which results in :

Expected: "0xn5t"
Received: 5

Is this something that's expected or is this a bug?

@bali182 bali182 changed the title Primitive serialization issue () Primitive serialization issue Apr 15, 2022
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