UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

38 lines (31 loc) 665 B
// import { assert } from "../assert.js"; /** * Represents data for a single localization */ export class LocaleDataset { /** * Localized objects, identified by localization key * @type {Object<Object|string>} * @private */ #map = {} /** * * Does a given key exist? * @param {string} key * @return {boolean} */ hasKey(key) { assert.isString(key, 'key'); return this.#map[key] !== undefined; } /** * * @param {string} key * @returns {string|Object|undefined} */ get(key) { return this.#map[key]; } }