jeremyfa / yaml.js

Standalone JavaScript YAML 1.2 Parser & Encoder. Works under node.js and all major browsers. Also brings command line YAML/JSON conversion tools.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable automatic conversion to non string type

crystalfp opened this issue · comments

Is it possible to disable the automatic conversion of values? In my yaml file I have: date: 2019-07-18. The library converts it to a Date object. Is it possible to disable this conversion and output it as a string? Same for the enty date: 2014 that is converted to a number.
Thanks for clarifying!
mario

AFAIK this is part of the spec. I believe you can add quotes if you want to ensure it is a string