@tspower/reflection
v1.2.2
Published
Easy javascript object reflection
Downloads
6
Maintainers
Readme
Reflection
Reflection simple ispect your javascript object!
Available Methods
1 - getProperties - return list of object properties
2 - getMethods - return list of object methods
3 - getPropertyByValue - return property name that match passed value
Documentation
Detailed documentation here
Install
npm i @tspower/reflection
Use
import {getProperties, getMethods, getPropertyByValue} from '@tspower/reflection'
let obj = {id:"first", value:55, call:function(){alert("hello world!"}}
let listProperties = getProperties(obj);
let listMethods = getMethods(obj);
let property = getPropertyByValue(obj, 55);
listProperty will contain ["id", "value"]
listMethods will contain ["call"]
property will contain: "value"
version history
@1.1.11 test inserted
@1.1.1 readme update
@1.1.0 add doc on methods
Author
Luigi Senzamici
Email: [email protected]
Pegaso Professional