0.1.1 • Published 7 years ago

reset-object v0.1.1

Weekly downloads
35
License
MIT
Repository
github
Last release
7 years ago

reset-object

Reset a JavaScript Object instance to its prototype definition

const resetObject = require('reset-object')

class MyClass {
  myFunc() {
    return 'this is myFunc'
  }
}

const obj = new MyClass()
obj.myFunc = () => 'new myFunc'

console.log(obj.myFunc()) // -> 'new myFunc'

resetObject(obj)

console.log(obj.myFunc()) // -> 'this is myFunc'

Install

npm install --save reset-object
0.1.1

7 years ago

0.1.0

7 years ago