-
Notifications
You must be signed in to change notification settings - Fork 941
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Some non numeric values are processed into numbers
Reproduction Steps
import { decode, encode } from '@toon-format/toon';
import deepEqual from 'fast-deep-equal';
const indent: number = 1;
function encodeToon(data: any): string {
return encode(data, { indent });
}
function decodeToon<T>(toon: string): T {
return decode(toon, { indent }) as any;
}
// The following values deserialize data unevenly
const data = [
'.6226633103089010',
'+8613334445577',
]
const encoded = encodeToon(data);
// [ 0.622663310308901, 8613334445577 ]
const decoded = decodeToon(encoded);
console.log(deepEqual(data, decoded)); // falseExpected Behavior
Should be equal
Actual Behavior
Not equal
Environment
"@toon-format/toon": "^2.1.0",
[email protected]
OS: macOS 15.7.2
Additional Context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working