MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / getPropertyValue

Function getPropertyValue

packages/core/src/utils/upsert-utils.ts:152–166  ·  view source on GitHub ↗
(obj: Dictionary, key: string)

Source from the content-addressed store, hash-verified

150}
151
152function getPropertyValue(obj: Dictionary, key: string) {
153 if (!key.includes('.')) {
154 return obj[key];
155 }
156
157 const parts = key.split('.');
158 let curr = obj;
159
160 for (let i = 0; i < parts.length - 1; i++) {
161 curr[parts[i]] ??= {};
162 curr = curr[parts[i]];
163 }
164
165 return curr[parts[parts.length - 1]];
166}
167
168/** @internal */
169export function getWhereCondition<T extends object>(

Callers 1

getWhereConditionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected