Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

87
Vistas
YAML/yamljs string deserialization behaviour

I was testing YAML (yamljs) with random inputs (please don't ask why it's a long story :D). I'm not very well versed in the YAML spec, but as far as I understand YAML should be able to serialize and deserialize primitives (strings, numbers, booleans) without an object or array wrapper. This however doesn't always seem to be the case.

I isolated one failing case:

import YAML from 'yamljs'

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

Where it '0xn5t' is somehow parsed back to 5

Expected: "0xn5t"
Received: 5

Could someone please guide me to the spec where this behaviour is explained? Could this be an issue with the library I'm using?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda