New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ng2-webstorage

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-webstorage - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

dist/app.metadata.json

66

bundles/core.umd.js

@@ -231,8 +231,2 @@ (function (global, factory) {

};
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var LocalStorageService = (function (_super) {

@@ -243,5 +237,7 @@ __extends(LocalStorageService, _super);

}
LocalStorageService = __decorate$1([
_angular_core.Injectable()
], LocalStorageService);
LocalStorageService.decorators = [
{ type: _angular_core.Injectable },
];
/** @nocollapse */
LocalStorageService.ctorParameters = [];
return LocalStorageService;

@@ -255,8 +251,2 @@ }(WebStorageService));

};
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var SessionStorageService = (function (_super) {

@@ -267,9 +257,11 @@ __extends$1(SessionStorageService, _super);

}
SessionStorageService = __decorate$2([
_angular_core.Injectable()
], SessionStorageService);
SessionStorageService.decorators = [
{ type: _angular_core.Injectable },
];
/** @nocollapse */
SessionStorageService.ctorParameters = [];
return SessionStorageService;
}(WebStorageService));
function WebStorage(webSKey, sType) {
var WebStorage = function WebStorageDecorator(webSKey, sType) {
return function (targetedClass, raw) {

@@ -287,33 +279,27 @@ var key = webSKey || raw, sKey = KeyStorageHelper.genKey(key);

};
}
};
function LocalStorage(webstorageKey) {
var LocalStorage = function LocalStorageDecorator(webstorageKey) {
return WebStorage(webstorageKey, STORAGE.local);
}
};
function SessionStorage(webstorageKey) {
var SessionStorage = function SessionStorageDecorator(webstorageKey) {
return WebStorage(webstorageKey, STORAGE.session);
}
};
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var Ng2Webstorage = (function () {
function Ng2Webstorage() {
}
Ng2Webstorage = __decorate([
_angular_core.NgModule({
declarations: [],
providers: [SessionStorageService, LocalStorageService],
imports: []
})
], Ng2Webstorage);
Ng2Webstorage.decorators = [
{ type: _angular_core.NgModule, args: [{
declarations: [],
providers: [SessionStorageService, LocalStorageService],
imports: []
},] },
];
/** @nocollapse */
Ng2Webstorage.ctorParameters = [];
return Ng2Webstorage;
}());
// # sourceMappingURL=index.js.map
exports.Ng2Webstorage = Ng2Webstorage;

@@ -331,2 +317,2 @@ exports.KeyStorageHelper = KeyStorageHelper;

})));
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS51bWQuanMiLCJzb3VyY2VzIjpbIi4uL2Rpc3QvZW51bXMvc3RvcmFnZS5qcyIsIi4uL2Rp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ZXhPZihmaWVsZCk7XHJcbiAgICB9O1xyXG4gICAgTW9ja1N0b3JhZ2VIZWxwZXIuZ2V0U3RvcmFnZSA9IGZ1bmN0aW9uIChzVHlwZSkge1xyXG4gICAgICAgIGlmICghdGhpcy5tb2NrU3RvcmFnZXNbc1R5cGVdKVxyXG4gICAgICAgICAgICB0aGlzLm1vY2tTdG9yYWdlc1tzVHlwZV0gPSBNb2NrU3RvcmFnZUhlbHBlci5nZW5lcmF0ZVN0b3JhZ2UoKTtcclxuICAgICAgICByZXR1cm4gdGhpcy5tb2NrU3RvcmFnZXNbc1R5cGVdO1xyXG4gICAgfTtcclxuICAgIE1vY2tTdG9yYWdlSGVscGVyLmdlbmVyYXRlU3RvcmFnZSA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICB2YXIgc3RvcmFnZSA9IHt9O1xyXG4gICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzKHN0b3JhZ2UsIHtcclxuICAgICAgICAgICAgc2V0SXRlbToge1xyXG4gICAgICAgICAgICAgICAgd3JpdGFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIChrZXksIHZhbHVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFNb2NrU3RvcmFnZUhlbHBlci5pc1NlY3VyZWRGaWVsZChrZXkpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzW2tleV0gPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGdldEl0ZW06IHtcclxuICAgICAgICAgICAgICAgIHdyaXRhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIHZhbHVlOiBmdW5jdGlvbiAoa2V5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICFNb2NrU3RvcmFnZUhlbHBlci5pc1NlY3VyZWRGaWVsZChrZXkpID8gdGhpc1trZXldIHx8IG51bGwgOiBudWxsO1xyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgcmVtb3ZlSXRlbToge1xyXG4gICAgICAgICAgICAgICAgd3JpdGFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIChrZXkpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIU1vY2tTdG9yYWdlSGVscGVyLmlzU2VjdXJlZEZpZWxkKGtleSkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB0aGlzW2tleV07XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBsZW5ndGg6IHtcclxuICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIGdldDogZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBPYmplY3Qua2V5cyh0aGlzKS5sZW5ndGg7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgICByZXR1cm4gc3RvcmFnZTtcclxuICAgIH07XHJcbiAgICBNb2NrU3RvcmFnZUhlbHBlci5zZWN1cmVkRmllbGRzID0gWydzZXRJdGVtJywgJ2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TW9ja1N0b3JhZ2VIZWxwZXIuaXNTZWN1cmVkRmllbGQoa2V5KSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1trZXldID0gdmFsdWU7XHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBnZXRJdGVtOiB7XHJcbiAgICAgICAgICAgICAgICB3cml0YWJsZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICB2YWx1ZTogZnVuY3Rpb24gKGtleSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAhTW9ja1N0b3JhZ2VIZWxwZXIuaXNTZWN1cmVkRmllbGQoa2V5KSA/IHRoaXNba2V5XSB8fCBudWxsIDogbnVsbDtcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHJlbW92ZUl0ZW06IHtcclxuICAgICAgICAgICAgICAgIHdyaXRhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIHZhbHVlOiBmdW5jdGlvbiAoa2V5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFNb2NrU3RvcmFnZUhlbHBlci5pc1NlY3VyZWRGaWVsZChrZXkpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgdGhpc1trZXldO1xyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbGVuZ3RoOiB7XHJcbiAgICAgICAgICAgICAgICBlbnVtZXJhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJ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CLEVBQUUsbUJBQW1CLENBQUM7b0JBQ3ZELE9BQU8sRUFBRSxFQUFFO2lCQUNkLEVBQUUsRUFBRTtLQUNoQixDQUFDOztJQUVGLGFBQWEsQ0FBQyxjQUFjLEdBQUcsRUFBRSxDQUFDO0lBQ2xDLE9BQU8sYUFBYSxDQUFDO0NBQ3hCLEVBQUUsQ0FBQyxDQUFDLEFBQ0wsOzs7Ozs7Ozs7LDs7LDs7In0=

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],t):t(e.ng2Webstorage=e.ng2Webstorage||{},e.ng.core)}(this,function(e,t){"use strict";function r(e,t){return function(r,n){var o=e||n,i=g.genKey(o);Object.defineProperty(r,n,{get:function(){return y.retrieve(t,i)},set:function(e){this[i]=e,y.store(t,i,e)}})}}function n(e){return r(e,i.local)}function o(e){return r(e,i.session)}var i;!function(e){e[e.local=0]="local",e[e.session=1]="session"}(i||(i={}));var s,a="ng2-webstorage",c="|",l=(s={},s[i.local]="local",s[i.session]="session",s),u=a,f=c,g=function(){function e(){}return e.retrieveKeysFromStorage=function(e){return Object.keys(e).filter(function(e){return 0===e.indexOf(u)})},e.genKey=function(e){if("string"!=typeof e)throw Error("attempt to generate a storage key with a non string value");return""+u+f+e.toString().toLowerCase()},e.setStorageKeyPrefix=function(e){void 0===e&&(e=a),u=e},e.setStorageKeySeparator=function(e){void 0===e&&(e=c),f=e},e}(),h=function(){function e(){}return e.observe=function(e,r){var n=this.genObserverKey(e,r);return n in this.observers?this.observers[n]:this.observers[n]=new t.EventEmitter},e.emit=function(e,t,r){var n=this.genObserverKey(e,t);n in this.observers&&this.observers[n].emit(r)},e.genObserverKey=function(e,t){return e+"|"+t},e.observers={},e}(),v=function(){function e(){}return e.isSecuredField=function(t){return!!~e.securedFields.indexOf(t)},e.getStorage=function(t){return this.mockStorages[t]||(this.mockStorages[t]=e.generateStorage()),this.mockStorages[t]},e.generateStorage=function(){var t={};return Object.defineProperties(t,{setItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t,r){e.isSecuredField(t)||(this[t]=r)}},getItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t){return e.isSecuredField(t)?null:this[t]||null}},removeItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t){e.isSecuredField(t)||delete this[t]}},length:{enumerable:!1,configurable:!1,get:function(){return Object.keys(this).length}}}),t},e.securedFields=["setItem","getItem","removeItem","length"],e.mockStorages={},e}(),y=function(){function e(){}return e.store=function(e,t,r){this.getStorage(e).setItem(t,JSON.stringify(r)),this.cached[e][t]=r,h.emit(e,t,r)},e.retrieve=function(e,t){if(this.cached[e][t])return this.cached[e][t];var r=null;try{r=JSON.parse(this.getStorage(e).getItem(t))}catch(e){console.warn("invalid value for "+t)}return this.cached[e][t]=r},e.clearAll=function(e){var t=this,r=this.getStorage(e);g.retrieveKeysFromStorage(r).forEach(function(n){r.removeItem(n),delete t.cached[e][n],h.emit(e,n,null)})},e.clear=function(e,t){this.getStorage(e).removeItem(t),delete this.cached[e][t],h.emit(e,t,null)},e.getStorage=function(e){return this.isStorageAvailable(e)?this.getWStorage(e):v.getStorage(e)},e.getWStorage=function(e){var t;switch(e){case i.local:t=localStorage;break;case i.session:t=sessionStorage;break;default:throw Error("invalid storage type")}return t},e.isStorageAvailable=function(e){if("boolean"==typeof this.storageAvailability[e])return this.storageAvailability[e];var t=!0,r=this.getWStorage(e);if("object"==typeof r)try{r.setItem("test-storage","foobar"),r.removeItem("test-storage")}catch(e){t=!1}else t=!1;return t||console.warn(l[e]+" storage unavailable, Ng2Webstorage will use a fallback strategy instead"),this.storageAvailability[e]=t},e.cached=(t={},t[i.local]={},t[i.session]={},t),e.storageAvailability=(r={},r[i.local]=null,r[i.session]=null,r),e;var t,r}(),p=function(){function e(e){void 0===e&&(e=null),this.sType=e,this.sType=e}return e.prototype.store=function(e,t){var r=g.genKey(e);y.store(this.sType,r,t)},e.prototype.retrieve=function(e){var t=g.genKey(e);return y.retrieve(this.sType,t)},e.prototype.clear=function(e){e?y.clear(this.sType,g.genKey(e)):y.clearAll(this.sType)},e.prototype.observe=function(e){var t=g.genKey(e);return h.observe(this.sType,t)},e}(),b=function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},d=function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},S=function(e){function r(){e.call(this,i.local)}return b(r,e),r=d([t.Injectable()],r)}(p),m=function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},O=function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},j=function(e){function r(){e.call(this,i.session)}return m(r,e),r=O([t.Injectable()],r)}(p),w=function(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s},I=function(){function e(){}return e=w([t.NgModule({declarations:[],providers:[j,S],imports:[]})],e)}();e.Ng2Webstorage=I,e.KeyStorageHelper=g,e.LocalStorage=n,e.SessionStorage=o,e.WebStorage=r,e.WebStorageService=p,e.LocalStorageService=S,e.SessionStorageService=j,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],t):t(e.ng2Webstorage=e.ng2Webstorage||{},e.ng.core)}(this,function(e,t){"use strict";var r;!function(e){e[e.local=0]="local",e[e.session=1]="session"}(r||(r={}));var o,n="ng2-webstorage",i="|",s=(o={},o[r.local]="local",o[r.session]="session",o),a=n,c=i,u=function(){function e(){}return e.retrieveKeysFromStorage=function(e){return Object.keys(e).filter(function(e){return 0===e.indexOf(a)})},e.genKey=function(e){if("string"!=typeof e)throw Error("attempt to generate a storage key with a non string value");return""+a+c+e.toString().toLowerCase()},e.setStorageKeyPrefix=function(e){void 0===e&&(e=n),a=e},e.setStorageKeySeparator=function(e){void 0===e&&(e=i),c=e},e}(),l=function(){function e(){}return e.observe=function(e,r){var o=this.genObserverKey(e,r);return o in this.observers?this.observers[o]:this.observers[o]=new t.EventEmitter},e.emit=function(e,t,r){var o=this.genObserverKey(e,t);o in this.observers&&this.observers[o].emit(r)},e.genObserverKey=function(e,t){return e+"|"+t},e.observers={},e}(),g=function(){function e(){}return e.isSecuredField=function(t){return!!~e.securedFields.indexOf(t)},e.getStorage=function(t){return this.mockStorages[t]||(this.mockStorages[t]=e.generateStorage()),this.mockStorages[t]},e.generateStorage=function(){var t={};return Object.defineProperties(t,{setItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t,r){e.isSecuredField(t)||(this[t]=r)}},getItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t){return e.isSecuredField(t)?null:this[t]||null}},removeItem:{writable:!1,enumerable:!1,configurable:!1,value:function(t){e.isSecuredField(t)||delete this[t]}},length:{enumerable:!1,configurable:!1,get:function(){return Object.keys(this).length}}}),t},e.securedFields=["setItem","getItem","removeItem","length"],e.mockStorages={},e}(),f=function(){function e(){}return e.store=function(e,t,r){this.getStorage(e).setItem(t,JSON.stringify(r)),this.cached[e][t]=r,l.emit(e,t,r)},e.retrieve=function(e,t){if(this.cached[e][t])return this.cached[e][t];var r=null;try{r=JSON.parse(this.getStorage(e).getItem(t))}catch(e){console.warn("invalid value for "+t)}return this.cached[e][t]=r},e.clearAll=function(e){var t=this,r=this.getStorage(e);u.retrieveKeysFromStorage(r).forEach(function(o){r.removeItem(o),delete t.cached[e][o],l.emit(e,o,null)})},e.clear=function(e,t){this.getStorage(e).removeItem(t),delete this.cached[e][t],l.emit(e,t,null)},e.getStorage=function(e){return this.isStorageAvailable(e)?this.getWStorage(e):g.getStorage(e)},e.getWStorage=function(e){var t;switch(e){case r.local:t=localStorage;break;case r.session:t=sessionStorage;break;default:throw Error("invalid storage type")}return t},e.isStorageAvailable=function(e){if("boolean"==typeof this.storageAvailability[e])return this.storageAvailability[e];var t=!0,r=this.getWStorage(e);if("object"==typeof r)try{r.setItem("test-storage","foobar"),r.removeItem("test-storage")}catch(e){t=!1}else t=!1;return t||console.warn(s[e]+" storage unavailable, Ng2Webstorage will use a fallback strategy instead"),this.storageAvailability[e]=t},e.cached=(t={},t[r.local]={},t[r.session]={},t),e.storageAvailability=(o={},o[r.local]=null,o[r.session]=null,o),e;var t,o}(),h=function(){function e(e){void 0===e&&(e=null),this.sType=e,this.sType=e}return e.prototype.store=function(e,t){var r=u.genKey(e);f.store(this.sType,r,t)},e.prototype.retrieve=function(e){var t=u.genKey(e);return f.retrieve(this.sType,t)},e.prototype.clear=function(e){e?f.clear(this.sType,u.genKey(e)):f.clearAll(this.sType)},e.prototype.observe=function(e){var t=u.genKey(e);return l.observe(this.sType,t)},e}(),v=function(e,t){function r(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},y=function(e){function o(){e.call(this,r.local)}return v(o,e),o.decorators=[{type:t.Injectable}],o.ctorParameters=[],o}(h),b=function(e,t){function r(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},p=function(e){function o(){e.call(this,r.session)}return b(o,e),o.decorators=[{type:t.Injectable}],o.ctorParameters=[],o}(h),d=function(e,t){return function(r,o){var n=e||o,i=u.genKey(n);Object.defineProperty(r,o,{get:function(){return f.retrieve(t,i)},set:function(e){this[i]=e,f.store(t,i,e)}})}},S=function(e){return d(e,r.local)},m=function(e){return d(e,r.session)},w=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{declarations:[],providers:[p,y],imports:[]}]}],e.ctorParameters=[],e}();e.Ng2Webstorage=w,e.KeyStorageHelper=u,e.LocalStorage=S,e.SessionStorage=m,e.WebStorage=d,e.WebStorageService=h,e.LocalStorageService=y,e.SessionStorageService=p,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -1,7 +0,1 @@

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { NgModule } from '@angular/core';

@@ -16,11 +10,13 @@ import { LocalStorageService, SessionStorageService } from './services/index';

}
Ng2Webstorage = __decorate([
NgModule({
declarations: [],
providers: [SessionStorageService, LocalStorageService],
imports: []
})
], Ng2Webstorage);
Ng2Webstorage.decorators = [
{ type: NgModule, args: [{
declarations: [],
providers: [SessionStorageService, LocalStorageService],
imports: []
},] },
];
/** @nocollapse */
Ng2Webstorage.ctorParameters = [];
return Ng2Webstorage;
}());
//# sourceMappingURL=app.js.map

@@ -1,1 +0,1 @@

export declare function LocalStorage(webstorageKey?: string): (targetedClass: Object, raw: string) => void;
export declare const LocalStorage: (webstorageKey?: string) => (targetedClass: Object, raw: string) => void;
import { WebStorage } from './webStorage';
import { STORAGE } from '../enums/storage';
export function LocalStorage(webstorageKey) {
export var LocalStorage = function LocalStorageDecorator(webstorageKey) {
return WebStorage(webstorageKey, STORAGE.local);
}
};
//# sourceMappingURL=localStorage.js.map

@@ -1,1 +0,1 @@

export declare function SessionStorage(webstorageKey?: string): (targetedClass: Object, raw: string) => void;
export declare const SessionStorage: (webstorageKey?: string) => (targetedClass: Object, raw: string) => void;
import { WebStorage } from './webStorage';
import { STORAGE } from '../enums/storage';
export function SessionStorage(webstorageKey) {
export var SessionStorage = function SessionStorageDecorator(webstorageKey) {
return WebStorage(webstorageKey, STORAGE.session);
}
};
//# sourceMappingURL=sessionStorage.js.map
import { STORAGE } from '../enums/storage';
export declare function WebStorage(webSKey: string, sType: STORAGE): (targetedClass: Object, raw: string) => void;
export declare const WebStorage: (webSKey: string, sType: STORAGE) => (targetedClass: Object, raw: string) => void;

@@ -1,4 +0,3 @@

import { KeyStorageHelper } from '../helpers/index';
import { WebStorageHelper } from '../helpers/index';
export function WebStorage(webSKey, sType) {
import { KeyStorageHelper, WebStorageHelper } from '../helpers/index';
export var WebStorage = function WebStorageDecorator(webSKey, sType) {
return function (targetedClass, raw) {

@@ -16,3 +15,3 @@ var key = webSKey || raw, sKey = KeyStorageHelper.genKey(key);

};
}
};
//# sourceMappingURL=webStorage.js.map

@@ -6,8 +6,2 @@ var __extends = (this && this.__extends) || function (d, b) {

};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Injectable } from '@angular/core';

@@ -21,7 +15,9 @@ import { STORAGE } from '../enums/storage';

}
LocalStorageService = __decorate([
Injectable()
], LocalStorageService);
LocalStorageService.decorators = [
{ type: Injectable },
];
/** @nocollapse */
LocalStorageService.ctorParameters = [];
return LocalStorageService;
}(WebStorageService));
//# sourceMappingURL=localStorage.js.map

@@ -6,8 +6,2 @@ var __extends = (this && this.__extends) || function (d, b) {

};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Injectable } from '@angular/core';

@@ -21,7 +15,9 @@ import { STORAGE } from '../enums/storage';

}
SessionStorageService = __decorate([
Injectable()
], SessionStorageService);
SessionStorageService.decorators = [
{ type: Injectable },
];
/** @nocollapse */
SessionStorageService.ctorParameters = [];
return SessionStorageService;
}(WebStorageService));
//# sourceMappingURL=sessionStorage.js.map
{
"name": "ng2-webstorage",
"version": "1.3.1",
"description": "angular2 webstorage manager",
"main": "bundles/core.umd.js",
"module": "index.js",
"typings": "index.d.ts",
"devDependencies": {
"@angular/common": "^2.0.1",
"@angular/compiler": "^2.0.1",
"@angular/core": "^2.0.1",
"@angular/forms": "^2.0.1",
"@angular/platform-browser": "2.0.1",
"@angular/platform-browser-dynamic": "^2.0.1",
"compression-webpack-plugin": "^0.3.1",
"es6-shim": "^0.35.1",
"es6-symbol": "^3.0.2",
"es7-reflect-metadata": "^1.6.0",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine-core": "2.4.1",
"karma": "^0.13.22",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-mocha-reporter": "^2.0.3",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
"remap-istanbul": "^0.6.4",
"rimraf": "^2.5.2",
"rollup": "^0.36.1",
"rxjs": "^5.0.0-beta.12",
"source-map-loader": "^0.1.5",
"ts-helpers": "^1.1.1",
"ts-loader": "^0.8.2",
"tslint": "^3.10.2",
"tslint-loader": "^2.1.4",
"typescript": "^2.0.3",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.13.0",
"zone.js": "^0.6.23"
},
"scripts": {
"tsc": "node node_modules/typescript/bin/tsc --p config/tsconfig.dist.json -d --rootDir lib --outDir dist",
"prebundle": "node node_modules/rollup/bin/rollup -c config/rollup.js",
"bundle": "uglifyjs --compress --mangle --output bundles/core.umd.min.js -- bundles/core.umd.js",
"clean": "node node_modules/rimraf/bin dist bundles",
"prebuild": "npm run clean",
"build": "npm run tsc && npm run bundle",
"dev": "webpack-dev-server --content-base example --port=8080 --hot --progress -c --config config/webpack.dev.js",
"dev2": "webpack-dev-server --content-base example --port=8081 --host 0.0.0.0 --hot --progress -c --config config/webpack.dev.js",
"test": "karma start",
"test:watch": "npm run test -- --auto-watch --no-single-run"
},
"repository": {
"type": "git",
"url": "git+https://github.com/PillowPillow/ng2-webstorage.git"
},
"keywords": [
"typescript",
"angular2",
"ng2",
"localstorage",
"sessionStorage"
],
"author": "Nicolas Gaignoux <https://github.com/PillowPillow>",
"license": "MIT",
"bugs": {
"url": "https://github.com/PillowPillow/ng2-webstorage/issues"
},
"homepage": "https://github.com/PillowPillow/ng2-webstorage#readme"
"name": "ng2-webstorage",
"version": "1.3.2",
"description": "angular2 webstorage manager",
"main": "bundles/core.umd.js",
"module": "dist/app.js",
"typings": "app.d.ts",
"devDependencies": {
"@angular/common": "^2.1.0",
"@angular/compiler": "^2.1.0",
"@angular/compiler-cli": "^2.1.0",
"@angular/core": "^2.1.0",
"@angular/forms": "^2.1.0",
"@angular/platform-browser": "2.1.0",
"@angular/platform-browser-dynamic": "^2.1.0",
"@angular/platform-server": "^2.1.0",
"compression-webpack-plugin": "^0.3.1",
"es6-shim": "^0.35.1",
"es6-symbol": "^3.0.2",
"es7-reflect-metadata": "^1.6.0",
"istanbul-instrumenter-loader": "^0.2.0",
"jasmine-core": "2.4.1",
"karma": "^0.13.22",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-mocha-reporter": "^2.0.3",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.7.0",
"remap-istanbul": "^0.6.4",
"rimraf": "^2.5.2",
"rollup": "^0.36.1",
"rxjs": "^5.0.0-beta.12",
"source-map-loader": "^0.1.5",
"ts-helpers": "^1.1.1",
"ts-loader": "^0.8.2",
"tslint": "^3.10.2",
"tslint-loader": "^2.1.4",
"typescript": "^2.0.3",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1",
"webpack-merge": "^0.13.0",
"zone.js": "^0.6.23"
},
"scripts": {
"ngc": "ngc --p config/tsconfig.dist.json",
"postngc": "node node_modules/rimraf/bin lib/**/app.ngfactory.*",
"prebundle": "node node_modules/rollup/bin/rollup -c config/rollup.js",
"bundle": "uglifyjs --compress --mangle --output bundles/core.umd.min.js -- bundles/core.umd.js",
"clean": "node node_modules/rimraf/bin dist bundles",
"prebuild": "npm run clean",
"build": "npm run ngc && npm run bundle",
"dev": "webpack-dev-server --content-base example --port=8080 --hot --progress -c --config config/webpack.dev.js",
"dev2": "webpack-dev-server --content-base example --port=8081 --host 0.0.0.0 --hot --progress -c --config config/webpack.dev.js",
"test": "karma start",
"test:watch": "npm run test -- --auto-watch --no-single-run"
},
"repository": {
"type": "git",
"url": "git+https://github.com/PillowPillow/ng2-webstorage.git"
},
"keywords": [
"typescript",
"angular2",
"ng2",
"localstorage",
"sessionStorage"
],
"author": "Nicolas Gaignoux <https://github.com/PillowPillow>",
"license": "MIT",
"bugs": {
"url": "https://github.com/PillowPillow/ng2-webstorage/issues"
},
"homepage": "https://github.com/PillowPillow/ng2-webstorage#readme"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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