Skip to content

NaN not parsed properly #4

Closed
Closed
@fizxmike

Description

@fizxmike

const vm = updateVm(CircularJson.parse(rawVm));

When saving my ViewModel I have some (expected) NaNs in my data/vm.cjson

When running in webpack dev mode, the line linked above throws an error. I had to do a string replace like so to get it to work:

const vm = updateVm(CircularJson.parse(rawVm.replace(/\bNaN\b/g, '"NaN"')));
However, I believe there is a possibility of Infinity and -Infinity too... so my hack doesn't completely solve problems like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions