unserializable

0.1.0 • Public • Published

unserializable

build status npm version npm downloads

Utilities for converting unserializable JavaScript objects and instances to serializable objects and vice versa.

Installation

npm install unserializable --save

Usage

This package exports the following:

  • unserializable - An object containing functions that will convert a serializable value to its unserializable form based on its type key.

  • serializable - An object containing functions that will convert an unserializable value to its serializable form based on its type key.

  • getType(value) - Gets the type of some value if it's unserializable.

Currently, the following types are supported:

  • Map - ES6 Map instance
  • Set - ES6 Set instance
  • Date - Date instance
  • RegExp - RegExp instance

Feel free to submit pull requests for more types!

Example

See redux-replicate-localforage.

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i unserializable

    Weekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • timbur