devalue-codec
v1.2.0
Published
Uses devalue serialize expressions while retaining the original object type
Downloads
131
Readme
devalue-codec
Uses devalue to serialize expressions while retaining the original object type.
Accepts the following types, including arrays and objects:
string
number
boolean
Date
bigint
Map
Set
ArrayBuffer
Int8Array
Int16Array
Int32Array
Uint8Array
Uint16Array
Uint32Array
Uint8ClampedArray
RegExp
undefined
null
Installation
npm install devalue-codec
Usage
import { stringify, parse } from "devalue-codec";
const encoded = stringify({
key: "value",
});
const decoded = parse(encoded);