MCPcopy Index your code
hub / github.com/messageformat/messageformat / _get

Function _get

packages/runtime/src/messages.mjs:284–294  ·  view source on GitHub ↗

@private

(obj, key)

Source from the content-addressed store, hash-verified

282
283/** @private */
284function _get(obj, key) {
285 if (!obj) return null;
286 if (Array.isArray(key)) {
287 for (let i = 0; i < key.length; ++i) {
288 obj = obj[key[i]];
289 if (!obj) return null;
290 }
291 return obj;
292 }
293 return obj[key];
294}
295
296/** @private */
297function _has(data, lc, key, fallback, type) {

Callers 2

getMethod · 0.85
_hasFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected