function createSetting() {
    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var _options$storage = options.storage,
        storage = _options$storage === undefined ? {} : _options$storage,
        _options$defaults = options.defaults,
        defaults = _options$defaults === undefined ? {} : _options$defaults,
        _options$configs = options.configs,
        configs = _options$configs === undefined ? {} : _options$configs;


    if (typeof storage.get !== 'function' || typeof storage.set !== 'function') {
        throw new TypeError('storage object should implement `get` and `set` methods.');
    }

    return new Proxy({}, {
        get: function get(target, property) {
            return getValue(storage, property, configs, defaults);
        },
        set: function set(target, property, value) {
            setValue(storage, property, value, configs);
            return true;
        }
    });
}
/**
 * Factory function to create a Settings proxy object
 * with getters and setters for persistent storage.
 *
 * Note: For the proxy to work as expected, make sure to
 * create `configs` and `defaults` objects with exact
 * keys to be able to return fallback values.
 *
 * @example
 * const storage = createStorage('myapp');
 * const configs = {
 *     showSomething: 'mymodule.show.something',
 *     showSomethingElse: 'mymodule.show.somethingelse',
 * };
 * const defaults = {
 *     showSomething: true,
 *     showSomethingElse: false,
 * };
 * const UserSettings = createSetting({storage, defaults, configs});
 *
 * UserSettings.showSomething // true
 * UserSettings.showSomethingElse // false
 * // set some settings
 * UserSettings.showSomethingElse = true;
 * // after app reload, etc
 * UserSettings.showSomethingElse // true
 *
 * @param  {Object} options.storage     The storage object that implements get/set
 * @param  {Object} options.defaults    Map of setting names and corresponding default values
 * @param  {Object} options.configs     Map of setting names and corresponding storage key
 * @return {Object}                     The settings proxy
 */
Factory function to create a Settings proxy object
with getters and setters for persistent storage.

For the proxy to work as expected, make sure to
create `configs` and `defaults` objects with exact
keys to be able to return fallback values.





@param  {Object} options.storage     The storage object that implements get/set
@param  {Object} options.defaults    Map of setting names and corresponding default values
@param  {Object} options.configs     Map of setting names and corresponding storage key
@return {Object}                     The settings proxy
Factory function to create a Settings proxy object with getters and setters for persistent storage . For the proxy to work as expected make sure to create ` configs ` and ` defaults ` objects with exact keys to be able to return fallback values . @param { Object } options . storage The storage object that implements get / set @param { Object } options . defaults Map of setting names and corresponding default values @param { Object } options . configs Map of setting names and corresponding storage key @return { Object } The settings proxy
function createSetting() {
    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var _options$storage = options.storage,
        storage = _options$storage === undefined ? {} : _options$storage,
        _options$defaults = options.defaults,
        defaults = _options$defaults === undefined ? {} : _options$defaults,
        _options$configs = options.configs,
        configs = _options$configs === undefined ? {} : _options$configs;
    if (typeof storage.get !== 'function' || typeof storage.set !== 'function') {
        throw new TypeError('storage object should implement `get` and `set` methods.');
    }
    return new Proxy({}, {
        get: function get(target, property) {
            return getValue(storage, property, configs, defaults);
        },
        set: function set(target, property, value) {
            setValue(storage, property, value, configs);
            return true;
        }
    });
}
function createSetting ( ) { var options = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ; var _options$storage = options . storage , storage = _options$storage === undefined ? { } : _options$storage , _options$defaults = options . defaults , defaults = _options$defaults === undefined ? { } : _options$defaults , _options$configs = options . configs , configs = _options$configs === undefined ? { } : _options$configs ; if ( typeof storage . get !== 'function' || typeof storage . set !== 'function' ) { throw new TypeError ( 'storage object should implement `get` and `set` methods.' ) ; } return new Proxy ( { } , { get : function get ( target , property ) { return getValue ( storage , property , configs , defaults ) ; } , set : function set ( target , property , value ) { setValue ( storage , property , value , configs ) ; return true ; } } ) ; }
Factory function to create a Settings proxy object
 with getters and setters for persistent storage.
Factory function to create a Settings proxy object with getters and setters for persistent storage .