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

Method hasObject

packages/runtime/src/messages.mjs:249–253  ·  view source on GitHub ↗

* Check if `key` is a message object for the locale * * `key` may be a `string` for functions at the root level, or `string[]` for * accessing hierarchical objects. If an exact match is not found and `fallback` * is true, the fallback locales are checked for the first match. * * @p

(key, lc, fallback)

Source from the content-addressed store, hash-verified

247 * @returns {boolean}
248 */
249 hasObject(key, lc, fallback) {
250 if (!lc) lc = this.locale;
251 const fb = fallback ? this.getFallback(lc) : null;
252 return _has(this._data, lc, key, fb, 'object');
253 }
254
255 /**
256 * Get the message or object corresponding to `key`

Callers 1

messages.jsFile · 0.80

Calls 2

getFallbackMethod · 0.95
_hasFunction · 0.85

Tested by

no test coverage detected