-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Stringify method remove Date Objects with empty object #63
Comments
With timestamp tag also don't work: const yaml = require('yaml')
const { timestamp } = require ('yaml/types/timestamp')
yaml.defaultOptions.tags = [timestamp]
let x = yaml.parse('2018-12-22 08:02:52')
// 2018-12-22T08:02:52.000Z
yaml.stringify(x)
// '{}\n' |
This turned out to be two different but overlapping issues. The original posted by @seiya-git was due to the internally-called In the case posted by @Hamper the mistake was in calling the schema-free As these technically count as new features, I'll include them in the next minor release, probably at the same time as adding blank-line support. I'm also tempted to add support for Once released, this is how it'll work: const date = new Date('2018-12-22T08:02:52Z')
YAML.stringify(date)
// '2018-12-22T08:02:52.000Z\n'
YAML.stringify(date, { version: '1.1' })
// '2018-12-22T08:02:52\n' |
Stringify method remove Date Objects with empty object
output:
The text was updated successfully, but these errors were encountered: