MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / getDeepProperty

Function getDeepProperty

packages/filter/src/query.ts:719–728  ·  view source on GitHub ↗

* Get nested properties by path * @param value - Value of an object * @param path - Path to the property

(value: AnyObject, path: string)

Source from the content-addressed store, hash-verified

717 * @param path - Path to the property
718 */
719function getDeepProperty(value: AnyObject, path: string): any {
720 const props = path.split('.');
721 for (const p of props) {
722 value = value[p];
723 if (value == null) {
724 return null;
725 }
726 }
727 return value;
728}
729
730export function filterTemplate(strings: TemplateStringsArray, ...keys: any[]) {
731 return function filter(ctx: AnyObject) {

Callers 1

filterTemplateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected