//

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];
    }

}
