1.0.0 • Published 4 years ago

strip-instance v1.0.0

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

strip-instance Travis CI Build Status

Remove class instances from objects.

NPM Badge

Install

npm install strip-instance

Usage

const stripInstance = require("strip-instance");

const someClass = new (class SomeClass {
	constructor() {
		this.value = "a";
	}
})();

console.log(someClass);
//=> SomeClass { value: "a" }

stripInstance(someClass);
//=> { value: "a" }

API

stripInstance(object)

object

Type: object or class instance

The object to strip.