@unikue/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'}, 'foo');    // 'bar'
      getProp({foo: {bar: 'foobar'}}, 'foo.bar'); // foobar