Vulnerabilities | |||||
---|---|---|---|---|---|
Version | Suggest | Low | Medium | High | Critical |
3.0.1 | 0 | 0 | 0 | 0 | 0 |
3.0.0 | 0 | 0 | 0 | 0 | 0 |
2.2.6 | 0 | 0 | 0 | 0 | 0 |
2.2.5 | 0 | 0 | 0 | 0 | 0 |
2.2.4 | 0 | 0 | 0 | 0 | 0 |
2.2.3 | 0 | 0 | 0 | 0 | 0 |
2.2.2 | 0 | 0 | 0 | 0 | 0 |
2.2.1 | 0 | 0 | 0 | 0 | 0 |
2.2.0 | 0 | 0 | 0 | 0 | 0 |
2.1.0 | 0 | 0 | 0 | 0 | 0 |
2.0.0 | 0 | 0 | 0 | 0 | 0 |
1.2.1 | 0 | 0 | 0 | 0 | 0 |
1.2.0 | 0 | 0 | 0 | 0 | 0 |
1.1.0 | 0 | 0 | 0 | 0 | 0 |
1.0.1 | 0 | 0 | 0 | 0 | 0 |
1.0.0 | 0 | 0 | 0 | 0 | 0 |
3.0.1 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
MIT - MIT LicenseTypeScript variable wrapper library, transpiled to ESNext JavaScript.
npm i @0x2e757/wrappers
Simple wrapper that can be used as a value container. Has derived LocalStorageWrapper
and SessionStorageWrapper
implementation that read and save their values to corresponding storages.
import { StaticWrapper } from "@0x2e757/Wrappers";
const wNumber = new StaticWrapper(0);
wNumber.subscribe(console.log);
wNumber.value = 1;
wNumber.value = 2;
wNumber.value += 3;
1
2
5
Advanced wrapper which contains dynamically computed value (it can not be set manually). Values are being computed only before they are going to be used.
import { StaticWrapper, DynamicWrapper } from "@0x2e757/Wrappers";
const wUsername = new StaticWrapper("John");
const wBalance = new StaticWrapper(100);
const wAccountInfo = new DynamicWrapper(() => `${wUsername.value} has ${wBalance.value}$.`);
wAccountInfo.subscribe(console.log);
wBalance.value -= 50;
John has 50$.
Helper class that dynamically will return either StaticWrapper
or DynamicWrapper
, depending on value type (is function or not) passed to the constructor.
import { Wrapper } from "@0x2e757/Wrappers";
const staticWrapper = new Wrapper(0);
const dynamicWrapper = new Wrapper(() => staticWrapper.value * 2);
dynamicWrapper.subscribe(console.log);
staticWrapper.value = 5;
10