stringify-clone
Wrapper for fast object cloning using `JSON.parse` & `JSON.stringify`
Last updated 4 years ago by ahmadnassri .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install stringify-clone 
SYNC missed versions from official npm registry.

Stringify Clone

Wrapper for fast object cloning using JSON.parse & JSON.stringify

license release semantic

IMPORTANT:

THIS IS A ONE LINE PACKAGE, THERE IS NO REASON FOR YOU TO USE IT!

Notes:

  • cannot clone RegExp (returns {})
  • NaN values will be converted to null
  • Date objects will be converted to ISO strings (equivalent of running Date.toISOString())
    • you can reconstruct the Date by calling new Date(string)

Install

npm install stringify-clone

Usage

API

clone()

const clone = require('stringify-clone')

clone({
  foo: 'bar'
})

Author: Ahmad Nassri • Twitter: @AhmadNassri

Current Tags

  • 3.0.2                                ...           latest (3 years ago)

19 Versions

  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           4 years ago
  • 2.0.12                                ...           5 years ago
  • 2.0.11                                ...           5 years ago
  • 2.0.10                                ...           5 years ago
  • 2.0.9                                ...           5 years ago
  • 2.0.8                                ...           6 years ago
  • 2.0.7                                ...           6 years ago
  • 2.0.6                                ...           6 years ago
  • 2.0.5                                ...           6 years ago
  • 2.0.4                                ...           6 years ago
  • 2.0.3                                ...           6 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.1                                ...           8 years ago
  • 2.0.0                                ...           10 years ago
  • 1.1.1                                ...           11 years ago
  • 1.1.0                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 77
Today 0
This Week 0
This Month 40
Last Day 0
Last Week 5
Last Month 3
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE