"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var shared_1 = require("./shared");
function createLocalStorage(options) {
    if (options === void 0) { options = {}; }
    var mode = options.mode || "auto";
    var actualMode = mode === "auto" ? shared_1.autoSelectMode() : mode;
    if (actualMode === "browser") {
        return window.localStorage;
    }
    else if (actualMode === "node") {
        throw new Error("Can not select \"node\" mode in browser");
    }
    else if (actualMode === "memory") {
        return require("localstorage-memory");
    }
    throw new Error("Unknown mode:" + actualMode);
}
exports.createLocalStorage = createLocalStorage;
//# sourceMappingURL=browser.js.map