Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web-storage-manager

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web-storage-manager - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

19

lib/web-storage-manager.js

@@ -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 @@ }

2

package.json
{
"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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc