Options
All
  • Public
  • Public/Protected
  • All
Menu

@tspower/reflection

Reflection alt text

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: luigisenzamici@gmail.com
Pegaso Professional

License

MIT License

Generated using TypeDoc