Skip to content

Comment on The perils of UUID primary keys in SQLiteparent

Comments

This can be avoided by supplying a reviver:

    const json = '{ "a": 9007199254740993 }'
    JSON.parse(json, (_key, value, context) => /^\d+$/.test(context.source) ? BigInt(context.source) : value)

Which can be avoided by using UUIDs

Or by putting that id between quotes so it's a string.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.