@tspower/reflection
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

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

/@tspower/reflection/

    Package Sidebar

    Install

    npm i @tspower/reflection

    Weekly Downloads

    1

    Version

    1.2.2

    License

    MIT

    Unpacked Size

    5.09 kB

    Total Files

    5

    Last publish

    Collaborators

    • luigisenzamici