sdk: update

This commit is contained in:
Koushik Dutta
2023-04-07 15:11:24 -07:00
parent 2383f16112
commit 71ee5727f1
5 changed files with 9 additions and 6 deletions

4
sdk/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/sdk",
"version": "0.2.86",
"version": "0.2.87",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/sdk",
"version": "0.2.86",
"version": "0.2.87",
"license": "ISC",
"dependencies": {
"@babel/preset-typescript": "^7.18.6",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/sdk",
"version": "0.2.86",
"version": "0.2.87",
"description": "",
"main": "dist/src/index.js",
"exports": {

View File

@@ -149,8 +149,11 @@ export class StorageSettings<T extends string> implements Settings {
if (!setting?.noStore) {
if (setting?.mapPut)
value = setting.mapPut(oldValue, value);
// nullish values should be removed, since Storage can't persist them correctly.
if (typeof value === 'object')
this.device.storage.setItem(key, JSON.stringify(value));
else if (value == null)
this.device.storage.removeItem(key);
else
this.device.storage.setItem(key, value?.toString());
}

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/types",
"version": "0.2.78",
"version": "0.2.79",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/types",
"version": "0.2.78",
"version": "0.2.79",
"license": "ISC",
"devDependencies": {
"@types/rimraf": "^3.0.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/types",
"version": "0.2.78",
"version": "0.2.79",
"description": "",
"main": "dist/index.js",
"author": "",