itemsholdr
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -548,2 +548,6 @@ declare namespace ItemsHoldr { | ||
/** | ||
* Toggles this.autoSave. | ||
*/ | ||
toggleAutoSave(): void; | ||
/** | ||
* Ensures a key exists in values. If it doesn't, and new values are | ||
@@ -550,0 +554,0 @@ * allowed, it creates it; otherwise, it throws an Error. |
@@ -16,5 +16,5 @@ var ItemsHoldr; | ||
this.settings = settings; | ||
this.prefix = settings.prefix || ""; | ||
this.autoSave = settings.autoSave; | ||
this.callbackArgs = settings.callbackArgs || []; | ||
this.prefix = settings.prefix || ""; | ||
this.allowNewItems = settings.allowNewItems === undefined | ||
@@ -242,2 +242,8 @@ ? true : settings.allowNewItems; | ||
/** | ||
* Toggles this.autoSave. | ||
*/ | ||
ItemsHoldr.prototype.toggleAutoSave = function () { | ||
this.autoSave = !this.autoSave; | ||
}; | ||
/** | ||
* Ensures a key exists in values. If it doesn't, and new values are | ||
@@ -661,3 +667,3 @@ * allowed, it creates it; otherwise, it throws an Error. | ||
var value = this.ItemsHolder.getLocalStorage()[this.ItemsHolder.getPrefix() + this.key]; | ||
if (typeof value === "undefined") { | ||
if (typeof value === "undefined" || value === "undefined") { | ||
return undefined; | ||
@@ -664,0 +670,0 @@ } |
@@ -0,1 +1,3 @@ | ||
namespace ItemsHoldr { | ||
@@ -497,5 +499,5 @@ /** | ||
this.settings = settings; | ||
this.prefix = settings.prefix || ""; | ||
this.autoSave = settings.autoSave; | ||
this.callbackArgs = settings.callbackArgs || []; | ||
this.prefix = settings.prefix || ""; | ||
@@ -761,2 +763,9 @@ this.allowNewItems = settings.allowNewItems === undefined | ||
/** | ||
* Toggles this.autoSave. | ||
*/ | ||
public toggleAutoSave(): void { | ||
this.autoSave = !this.autoSave; | ||
} | ||
/** | ||
* Ensures a key exists in values. If it doesn't, and new values are | ||
@@ -1307,3 +1316,3 @@ * allowed, it creates it; otherwise, it throws an Error. | ||
if (typeof value === "undefined") { | ||
if (typeof value === "undefined" || value === "undefined") { | ||
return undefined; | ||
@@ -1310,0 +1319,0 @@ } |
{ | ||
"name": "itemsholdr", | ||
"description": "A cache-based wrapper around localStorage.", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Josh Goldberg", |
@@ -16,5 +16,5 @@ define(["require", "exports", "./ItemValue"], function (require, exports, ItemValue_1) { | ||
this.settings = settings; | ||
this.prefix = settings.prefix || ""; | ||
this.autoSave = settings.autoSave; | ||
this.callbackArgs = settings.callbackArgs || []; | ||
this.prefix = settings.prefix || ""; | ||
this.allowNewItems = settings.allowNewItems === undefined | ||
@@ -242,2 +242,8 @@ ? true : settings.allowNewItems; | ||
/** | ||
* Toggles this.autoSave. | ||
*/ | ||
ItemsHoldr.prototype.toggleAutoSave = function () { | ||
this.autoSave = !this.autoSave; | ||
}; | ||
/** | ||
* Ensures a key exists in values. If it doesn't, and new values are | ||
@@ -244,0 +250,0 @@ * allowed, it creates it; otherwise, it throws an Error. |
@@ -77,5 +77,5 @@ import { IItemsHoldr, IItemsHoldrSettings, IItems } from "./IItemsHoldr"; | ||
this.settings = settings; | ||
this.prefix = settings.prefix || ""; | ||
this.autoSave = settings.autoSave; | ||
this.callbackArgs = settings.callbackArgs || []; | ||
this.prefix = settings.prefix || ""; | ||
@@ -341,2 +341,9 @@ this.allowNewItems = settings.allowNewItems === undefined | ||
/** | ||
* Toggles this.autoSave. | ||
*/ | ||
public toggleAutoSave(): void { | ||
this.autoSave = !this.autoSave; | ||
} | ||
/** | ||
* Ensures a key exists in values. If it doesn't, and new values are | ||
@@ -343,0 +350,0 @@ * allowed, it creates it; otherwise, it throws an Error. |
@@ -166,3 +166,3 @@ define(["require", "exports"], function (require, exports) { | ||
var value = this.ItemsHolder.getLocalStorage()[this.ItemsHolder.getPrefix() + this.key]; | ||
if (typeof value === "undefined") { | ||
if (typeof value === "undefined" || value === "undefined") { | ||
return undefined; | ||
@@ -169,0 +169,0 @@ } |
@@ -270,3 +270,3 @@ import { IItemValue, ITriggers } from "./IItemValue"; | ||
if (typeof value === "undefined") { | ||
if (typeof value === "undefined" || value === "undefined") { | ||
return undefined; | ||
@@ -273,0 +273,0 @@ } |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
218016
5711
0