@ianwalter/clone

A configurable utility to clone JavaScript data (Objects, Arrays, etc)
38,730
Install
npm install @ianwalter/clone
Latest Version:6.0.1
Vue:2
License:Custom
Last Updated:Feb 26, 2020
Links: npm
Maintainer: ianwalter

@ianwalter/clone

A configurable utility to clone JavaScript data (Objects, Arrays, etc)

npm page CI

About

I created clone because I wanted to use the terrific nanoclone utility but not have the source Object's prototype properties be copied.

The difference, for my purposes, is to be able to clone an Object without cloning it's getters and setters. The state management library Vuex uses Object getters and setters for it's "reactive" functionality and there are times when you might want to extract and mutate data from the store without those mutations affecting the original data in the store.

Installation

yarn add @ianwalter/clone

Usage

import clone from '@ianwalter/clone'

const clonedBook = clone(book)

License

Apache 2.0 with Commons Clause - See LICENSE

 

Created by Ian Walter

Related Packages

spyfu-vuex-helpers

Utility functions for Vuex.

2,459 9
vuex-pathify

Ridiculously simple Vuex setup + wiring

322,817 1,358
direct-vuex

Use and implement your Vuex store with TypeScript types. Compatible with the Vue...

90,286 255
undo-redo-vuex

A Vuex plugin for module namespaced undo and redo functionality. This plugin tak...

9,207 47
vuex-typescript-fsa

The helper which makes vuex more type-safety

7,911

Version History

Version Released Vue License
6.0.1 ^2.6.11 Custom
6.0.0 ^2.6.11 Custom
5.0.0 ^2.6.11 Custom
4.1.0 ^2.6.10 Custom
4.0.0 ^2.6.10 Custom