@yookue/ts-lang-utils
    Preparing search index...

    Function getProp

    • Returns the property value if property name is present on the given object

      Parameters

      • object: any

        the object to inspect

      • Optionalprop: null | string

        the property name to inspect, parent property and child property are concat with dot (.)

      • OptionaldefaultValue: any

        the default value if the prop cannot be found

      Returns any

      the property value if property name is present on the given object

      David Hsing

      getProp({foo: {bar: 'foobar'}}, 'foo.bar');    // foobar