web-storage-manager
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -75,8 +75,3 @@ require("core-js/modules/es7.symbol.async-iterator"); | ||
const newData = exports.combineObject(value, collection); | ||
if (r[0] === 1) { | ||
return exports.setEncodeItem(key, newData); | ||
} else if (r[0] === 0) { | ||
return exports.setItem(key, newData); | ||
} | ||
return exports.setItem(key, newData, r[0] === 1); | ||
} catch (error) { | ||
@@ -203,7 +198,3 @@ throw error; | ||
if (r[0] === 1) { | ||
return exports.setEncodeItem(parentKey, newCollection); | ||
} else if (r[0] === 0) { | ||
return exports.setItem(parentKey, newCollection); | ||
} | ||
return exports.setItem(parentKey, newCollection, r[0] === 1); | ||
} | ||
@@ -342,7 +333,3 @@ } | ||
if (r === 1) { | ||
return exports.setEncodeItem(parentKey, newCollection); | ||
} else if (r === 0) { | ||
return exports.setItem(parentKey, newCollection); | ||
} | ||
return exports.setItem(parentKey, newCollection, r[0] === 1); | ||
} | ||
@@ -349,0 +336,0 @@ } |
{ | ||
"name": "web-storage-manager", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Web utility storage manager to handle save, update and data purge", | ||
@@ -5,0 +5,0 @@ "main": "lib/web-storage-manager.js", |
@@ -92,3 +92,3 @@ # Web Storage Manager | ||
Storage.setItem('test-sample', parentItem); | ||
Storage.setItem('test-sample', parentItem, true); | ||
Storage.setItem('test-sample-for-compare', parentItem); | ||
@@ -98,3 +98,3 @@ | ||
id: 2, | ||
value: '010', | ||
value: '01220', | ||
description: 'test item 101' | ||
@@ -104,5 +104,39 @@ } | ||
const keyPaths = [ 'targetKeyOnParent', 'collection', 'targetObject', 'changethis'] | ||
Storage.updateItemInItem('test-sample', keyPaths, valueInObj, 'id') | ||
const keyPaths2 = [ 'targetKeyOnParent', 'collection', 'targetObject', 'changethis2'] | ||
Storage.updateItemInItem('test-sample', keyPaths, valueInObj, 'id') | ||
Storage.updateItemInItem('test-sample', keyPaths2, valueInObj) | ||
const keyPaths3 = [ 'targetKeyOnParent', 'collection', 'targetObject2'] | ||
Storage.updateItemInItem('test-sample', keyPaths3, testItems) | ||
const valueInObj2 = { | ||
id: 1, | ||
value: '015', | ||
description: 'test item 151' | ||
} | ||
const keyPaths4 = [ 'targetKeyOnParent', 'collection', 'targetObject2'] | ||
Storage.updateItemInItem('test-sample', keyPaths4, valueInObj2) | ||
// append | ||
Storage.appendItem('test-sample', { new_item : { desc: 'new test item' } }) | ||
Storage.removeItemInItem('test-sample', keyPaths, valueInObj, 'id') | ||
Storage.setItem('copy', Storage.getItem('test-sample')) | ||
// save multiple | ||
Storage.setMultiple([ | ||
{ | ||
key: 'multiple-save-1', | ||
value: 'multiple-save-data-1' | ||
}, | ||
{ | ||
key: 'multiple-save-2', | ||
value: ['multiple-save-data-2', 'multiple-save-data-2'] | ||
},{ | ||
key: 'multiple-save-3', | ||
value: { desc: 'multiple-save-data-3' } | ||
} | ||
]) | ||
} | ||
@@ -150,10 +184,8 @@ | ||
isDataEncoded: ƒ (data) | ||
purge: ƒ () // remove all saved data under active domain | ||
purge: ƒ () | ||
removeItem: ƒ (key) | ||
removeItemInItem: ƒ (parentKey, childKeys, value, attrCompare) | ||
removeMultiple: ƒ (keys) | ||
setEncodeItem: ƒ (key, value) | ||
setEncodeMultiple: ƒ (items) | ||
setItem: ƒ (key, value) | ||
setMultiple: ƒ (items) | ||
setItem: ƒ (key, value, encoded) | ||
setMultiple: ƒ (items, encoded) | ||
storage: ƒ () | ||
@@ -160,0 +192,0 @@ updateItemInItem: ƒ (parentKey, childKeys, value, attrCompare) |
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
215826
202
404