Serialization types and validation functions.
npm run build
npm test
Launching the build
NPM script will invoke the Typescript compiler and output
the compiled source, as well as declaration files, to a folder named build/
.
The s11n
library exposes a collection of functions used to determine whether
values are serializable.
import * as s11n from "s11n";
const my_arr = [ "Hello", 42, { x: 4, y: 2 } ];
if (s11n.isSerializableArray(my_arr)) {
// Yay! `JSON.parse(JSON.stringify(my_arr))` will yield a new object that is
// identical to `my_arr`, because all elements of `my_arr` are serializable.
}
See the LICENSE
file for license information.