Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
generics-storage
Advanced tools
local storage for any implementation or cookie with immutable-helper
local storage for any implementation or cookie with immutable-helper update
yarn add immutable-helper generics-storage
or
npm install immutable-helper generics-storage --save
import {GenericsStorage} from 'generics-storage';
const storage = new GenericsStorage(); // default storage is cookie
const query = {$push: [1, 2, "test"]}; // immutable-helper query
storage.update("some-field", query);
storage.getValue("some-field");
// should be an array [1, 2, "test"]
storage.remove("some-field");
// undefined
Method | Argument(Type) | Return Type | Description |
---|---|---|---|
update | key: string, query: object | void | update current object or array to key by query |
getValue | key: string | object or Array | Get value (object or array) from key |
remove | key: string | void | Clean data of key |
import * as Cookies from 'js-cookie';
import {Storage, GenericsStorage} from 'generics-storage';
export class CookieStorage implements Storage {
setItem(key, value) {
Cookies.set(key, value);
}
getItem(key) {
return Cookies.get(key);
}
removeItem(key) {
Cookies.remove(key);
}
}
const cookie = new CookieStorage();
export const storage = new GenericsStorage(cookie);
npm test
FAQs
local storage for any implementation or cookie with immutable-helper
We found that generics-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.