0.1.0 • Published 10 years ago

unserializable v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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.