By default, numerical values (!!int and !!float) are represented using the native JS Number, which has limits to the precision and absolute value of what it can represent before overflowing:
import { parseDocument } from 'yaml'
const doc = parseDocument('gitsha: 61e9540')
doc.get('gitsha', true)
Scalar {
value: Infinity,
range: [ 8, 15, 15 ],
source: '61e9540',
type: 'PLAIN',
format: 'EXP'
}
Note, however, that we already retain the string source of the value. When serialising the above, we should make use of it, so that we don't end up with:
By default, numerical values (
!!intand!!float) are represented using the native JS Number, which has limits to the precision and absolute value of what it can represent before overflowing:Note, however, that we already retain the string source of the value. When serialising the above, we should make use of it, so that we don't end up with: