1.0.2 • Published 7 years ago
class-to-literal v1.0.2
Class to Literal
Copy all methods and properties from class object (and parents) to a new object literal.
Install
npm i class-to-literal
Usage
const classToLiteral = require('class-to-literal');
classToLiteral.convert(myClass);
Advanced
You can use conditions to put some propeties into another property.
classToLiteral.convert(myClass, [{
condition: propertyValue => typeof propertyValue === 'function',
destination: 'functions'
}]);