1.0.0 • Published 5 years ago

s11n v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

s11n

npm GitHub repository license

Serialization types and validation functions.

Build & Test

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/.

Usage

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.
}

License

See the LICENSE file for license information.