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
$ cnpm install stringify-clone 
SYNC missed versions from official npm registry.

Stringify Clone

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

license release super linter test 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

  • 2.0.12                                ...           latest (4 years ago)

16 Versions

  • 2.0.12                                ...           4 years ago
  • 2.0.11                                ...           4 years ago
  • 2.0.10                                ...           5 years ago
  • 2.0.9                                ...           5 years ago
  • 2.0.8                                ...           5 years ago
  • 2.0.7                                ...           5 years ago
  • 2.0.6                                ...           5 years ago
  • 2.0.5                                ...           5 years ago
  • 2.0.4                                ...           5 years ago
  • 2.0.3                                ...           6 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           9 years ago
  • 1.1.1                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |