moodle/lib/amd/build/sessionstorage.min.js.map

1 line
2.9 KiB
Plaintext

{"version":3,"sources":["../src/sessionstorage.js"],"names":["define","config","StorageWrapper","storage","window","sessionStorage","get","key","set","value"],"mappings":"AA6BAA,OAAM,uBAAC,CAAC,aAAD,CAAgB,qBAAhB,CAAD,CAAyC,SAASC,CAAT,CAAiBC,CAAjB,CAAiC,CAI5E,GAAIC,CAAAA,CAAO,CAAG,GAAID,CAAAA,CAAJ,CAAmBE,MAAM,CAACC,cAA1B,CAAd,CAEA,MAAgD,CAQ5CC,GAAG,CAAE,aAASC,CAAT,CAAc,CACf,MAAOJ,CAAAA,CAAO,CAACG,GAAR,CAAYC,CAAZ,CACV,CAV2C,CAoB5CC,GAAG,CAAE,aAASD,CAAT,CAAcE,CAAd,CAAqB,CACtB,MAAON,CAAAA,CAAO,CAACK,GAAR,CAAYD,CAAZ,CAAiBE,CAAjB,CACV,CAtB2C,CAyBnD,CA/BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Simple API for set/get to sessionstorage, with cacherev expiration.\n *\n * Session storage will only persist for as long as the browser window\n * stays open.\n *\n * See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage\n *\n * @module core/sessionstorage\n * @package core\n * @copyright 2017 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/config', 'core/storagewrapper'], function(config, StorageWrapper) {\n\n // Private functions and variables.\n /** @var {Object} StorageWrapper - Wraps browsers sessionStorage object */\n var storage = new StorageWrapper(window.sessionStorage);\n\n return /** @alias module:core/sessionstorage */ {\n /**\n * Get a value from session storage. Remember - all values must be strings.\n *\n * @method get\n * @param {string} key The cache key to check.\n * @return {boolean|string} False if the value is not in the cache, or some other error - a string otherwise.\n */\n get: function(key) {\n return storage.get(key);\n },\n\n /**\n * Set a value to session storage. Remember - all values must be strings.\n *\n * @method set\n * @param {string} key The cache key to set.\n * @param {string} value The value to set.\n * @return {boolean} False if the value can't be saved in the cache, or some other error - true otherwise.\n */\n set: function(key, value) {\n return storage.set(key, value);\n }\n\n };\n});\n"],"file":"sessionstorage.min.js"}