web-storage-manager
Advanced tools
Comparing version 1.0.13 to 1.0.14
@@ -185,4 +185,6 @@ require("core-js/modules/es7.symbol.async-iterator"); | ||
const key = _ref2[1]; | ||
collection = mapData(key, collection); | ||
collection = collection[key.trim()]; // map data get value from key path | ||
if (!collection) return false; // terminate on key not found | ||
if (idx === childKeys.length - 1) { | ||
@@ -210,7 +212,2 @@ if (!Array.isArray(collection)) { | ||
} | ||
} // map data get value from key path | ||
function mapData(key, collection) { | ||
return collection[key]; | ||
} // map data and update collection | ||
@@ -281,4 +278,6 @@ | ||
const key = _ref6[1]; | ||
collection = mapData(key, collection); | ||
collection = collection[key.trim()]; // map data get value from key path | ||
if (!collection) return false; // terminate on key not found | ||
if (idx === childKeys.length - 1) { | ||
@@ -306,7 +305,2 @@ if (!Array.isArray(collection)) { | ||
} | ||
} // map data get value from key path | ||
function mapData(key, collection) { | ||
return collection[key]; | ||
} // map data and update collection | ||
@@ -470,2 +464,17 @@ | ||
* | ||
* will check if there's saved data under this domain | ||
* @param {string} key - key names of your saved data | ||
*/ | ||
exports.hasData = key => { | ||
try { | ||
const data = storage.getItem(key); | ||
return data; | ||
} catch (error) { | ||
throw error; | ||
} | ||
}; | ||
/** | ||
* | ||
* will purge all saved data under this domain | ||
@@ -472,0 +481,0 @@ * |
{ | ||
"name": "web-storage-manager", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "Web utility storage manager to handle save, update and data purge", | ||
@@ -5,0 +5,0 @@ "main": "lib/web-storage-manager.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17428
426