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

judel

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

judel - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

0

.vscode/launch.json

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ const judel = require('../../index.js');

@@ -0,0 +0,0 @@ const Base = require('./libs/adaptor/base');

11

libs/adaptor/asyncStorage.js

@@ -8,2 +8,13 @@ function AsyncStorage(RNAsyncStorage) {

this.multiSet = async function (keyValuePairs = []) {
await new Promise((res, rej) => {
this.RNAsyncStorage.multiSet(keyValuePairs, err => {
if (err)
rej(err);
else
res();
});
});
}
this.getItem = async function (key = "") {

@@ -10,0 +21,0 @@ return await this.RNAsyncStorage.getItem(key);

@@ -8,2 +8,8 @@ var storage = {};

this.multiSet = async function (keyValuePairs = []) {
keyValuePairs.forEach(keyValuePair => {
storage[keyValuePair[0]] = keyValuePair[1];
});
}
this.getItem = async function (key = "") {

@@ -10,0 +16,0 @@ return storage[key];

@@ -0,0 +0,0 @@ function Base (name, { adaptor }) {

@@ -0,0 +0,0 @@ const Repo = require('./repo');

@@ -13,2 +13,14 @@ const uuidv4 = require('uuid/v4');

this.bulkInsert = async function (items = []) {
var keyValuePairs = items.map(item => {
item.id = item.id || uuidv4();
return [
this.name + item.id,
JSON.stringify(item)
];
});
await this.adaptor.multiSet(keyValuePairs);
return items;
}
this.update = async function (item) {

@@ -15,0 +27,0 @@ var old = await this.get(item.id);

2

package.json
{
"name": "judel",
"version": "1.0.3",
"version": "1.1.0",
"description": "For javascript key/value storage like react-native async-storage.",

@@ -5,0 +5,0 @@ "main": "index.js",

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