jonschlinkert / gray-matter

Smarter YAML front matter parser, used by metalsmith, Gatsby, Netlify, Assemble, mapbox-gl, phenomic, vuejs vitepress, TinaCMS, Shopify Polaris, Ant Design, Astro, hashicorp, garden, slidev, saber, sourcegraph, and many others. Simple to use, and battle tested. Parses YAML by default but can also parse JSON Front Matter, Coffee Front Matter, TOML Front Matter, and has support for custom parsers. Please follow gray-matter's author: https://github.com/jonschlinkert

Home Page:https://github.com/jonschlinkert

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Max Integer Size

symbiosdotwiki opened this issue · comments

commented

I am noticing a problem with long integers (in my case ID numbers from flickr) which when they are imported with gray matter they are incorrect. I assume this is due to floating point error.

A typical flickr API number is 72157688988508171 which is then cast to 72157688988508180

This is easy enough to avoid by adding string quotes to the ID but perhaps gray matter should detect these cases and properly cast to string or something?

commented

Is it possible to set the "type" of different YAML parameters in javascript (not typescript) so as to avoid this? Or to tell matter to interpret all parameters as strings?