Open
Description
I have been having an issue where date strings are being converted to date objects but I want to keep them as strings.
The load function works without a schema specified. I tried using the various schemas hoping I could get just plain old strings but specifying any schema results in the error:
TypeError: Cannot read properties of undefined (reading 'length')
[46](https://github.com/mjgs/convert-data-using-scripts/actions/runs/4892166937/jobs/8733596341#step:17:47)
at composeNode (/home/runner/work/convert-data-using-scripts/convert-data-using-scripts/main/node_modules/js-yaml/lib/loader.js:1492:60)
I specified the schema like so:
const jsYaml = require('js-yaml');
const { fm, content } = extractFrontmatter(contents);
const extractedData = jsYaml.load(fm, {
schema: 'FAILSAFE_SCHEMA'
});
Are schemas broken? Is there another way to prevent date strings being converted into date objects?
Metadata
Metadata
Assignees
Labels
No labels