s11n
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i s11n

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

8.44 kB

Total Files

7

Last publish

Collaborators

  • mgthomas99