-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added as optional parameter in .getItem(key, noParse) method
- Loading branch information
Showing
8 changed files
with
45 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/*! [email protected].1. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ | ||
/*! [email protected].2. Jherax 2017. Visit https://github.com/jherax/proxy-storage */ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
|
@@ -468,22 +468,23 @@ var WebStorage = function () { | |
* Retrieves a value by its key name. | ||
* | ||
* @param {string} key: keyname of the storage | ||
* @param {boolean} noParse: if the value shoudn't be parsed with `JSON.parse` | ||
* @return {void} | ||
* | ||
* @memberOf WebStorage | ||
*/ | ||
|
||
}, { | ||
key: 'getItem', | ||
value: function getItem(key) { | ||
value: function getItem(key, noParse) { | ||
(0, _utils.checkEmpty)(key); | ||
var value = _proxyMechanism.proxy[this.__storage__].getItem(key); | ||
if (value == null) { | ||
// null or undefined | ||
delete this[key]; | ||
value = null; | ||
} else { | ||
value = (0, _utils.tryParse)(value); | ||
if (noParse !== true) value = (0, _utils.tryParse)(value); | ||
this[key] = value; | ||
} | ||
var v = (0, _interceptors2.default)('getItem', key, value); | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "proxy-storage", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "Normalizes the API for cookies, and localStorage/sessionStorage", | ||
"author": "David Rivera <[email protected]>", | ||
"main": "src/proxy-storage.js", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters