/** * Copyright (c) 2020 IoTize SAS * * The following code is based on https://github.com/cosmosio/nested-property * It has been translated to Typescript (based on Javascript implementation) * Function behavior has been modified from original version * * @license nested-property https://github.com/cosmosio/nested-property * * The MIT License (MIT) * * Copyright (c) 2014-2015 Olivier Scherrer */ /** * Get the property of an object nested in one or more objects * given an object such as a.b.c.d = 5, getNestedProperty(a, "b.c.d") will return 5. * * @param object the object to get the property from * @param property the path to the property as a string * @returns the object or the the property value if found */ export declare function getNestedProperty(object: T, property: string | keyof T): T | T[keyof T & number] | undefined; /** * Tell if a nested object has a given property (or array a given index) * given an object such as a.b.c.d = 5, hasNestedProperty(a, "b.c.d") will return true. * It also returns true if the property is in the prototype chain. * * The MIT License (MIT) * Copyright (c) 2014-2015 Olivier Scherrer * * @param object the object to get the property from * @param property the path to the property as a string * @param options: * - own: set to reject properties from the prototype * @returns true if has (property in object), false otherwise */ export declare function hasNestedProperty(object: T, property: string | keyof T, options?: { own?: boolean; }): boolean | T; /** * Set the property of an object nested in one or more objects * If the property doesn't exist, it gets created. * * The MIT License (MIT) * Copyright (c) 2014-2015 Olivier Scherrer * * @param object * @param property * @param value the value to set * @returns object if no assignment was made or the value if the assignment was made */ export declare function setNestedProperty(object: T, property: string | number, value: any): any;