Function
getPropertyValue
(obj: Dictionary, key: string)
Source from the content-addressed store, hash-verified
| 150 | } |
| 151 | |
| 152 | function 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 */ |
| 169 | export function getWhereCondition<T extends object>( |
Tested by
no test coverage detected