Very large and very small numbers cannot be exactly represented with a JS Number.
When parsing a YAML document with such values (e.g. 1e-400, 61e9540), we should emit a warning if we're representing them as a Number with lossy precision.
This would correspond to what we're already doing when parsing a mapping with a non-scalar key as an Object rather than a Map:
|
warn( |
|
ctx.doc.options.logLevel, |
|
`Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.` |
|
) |
Very large and very small numbers cannot be exactly represented with a JS Number.
When parsing a YAML document with such values (e.g.
1e-400,61e9540), we should emit a warning if we're representing them as a Number with lossy precision.This would correspond to what we're already doing when parsing a mapping with a non-scalar key as an Object rather than a Map:
yaml/src/nodes/addPairToJSMap.ts
Lines 59 to 62 in 1dbf1c7