ng2-webstorage
Advanced tools
Comparing version 1.2.4 to 1.2.5
export declare const LIB_KEY: string; | ||
export declare const LIB_KEY_SEPARATOR: string; | ||
export declare const STORAGE_NAMES: {}; |
"use strict"; | ||
var storage_1 = require('../enums/storage'); | ||
exports.LIB_KEY = 'ng2-webstorage'; | ||
exports.LIB_KEY_SEPARATOR = '|'; | ||
exports.STORAGE_NAMES = (_a = {}, | ||
@@ -5,0 +6,0 @@ _a[storage_1.STORAGE.local] = 'local', |
@@ -6,2 +6,3 @@ import { IWebStorage } from '../interfaces/webStorage'; | ||
static setStorageKeyPrefix(key?: string): void; | ||
static setStorageKeySeparator(separator?: string): void; | ||
} |
"use strict"; | ||
var lib_1 = require('../constants/lib'); | ||
var CUSTOM_LIB_KEY = lib_1.LIB_KEY; | ||
var CUSTOM_LIB_KEY_SEPARATOR = lib_1.LIB_KEY_SEPARATOR; | ||
var KeyStorageHelper = (function () { | ||
@@ -13,3 +14,3 @@ function KeyStorageHelper() { | ||
throw Error('attempt to generate a storage key with a non string value'); | ||
return CUSTOM_LIB_KEY + "|" + raw.toString().toLowerCase(); | ||
return "" + CUSTOM_LIB_KEY + CUSTOM_LIB_KEY_SEPARATOR + raw.toString().toLowerCase(); | ||
}; | ||
@@ -20,2 +21,6 @@ KeyStorageHelper.setStorageKeyPrefix = function (key) { | ||
}; | ||
KeyStorageHelper.setStorageKeySeparator = function (separator) { | ||
if (separator === void 0) { separator = lib_1.LIB_KEY_SEPARATOR; } | ||
CUSTOM_LIB_KEY_SEPARATOR = separator; | ||
}; | ||
return KeyStorageHelper; | ||
@@ -22,0 +27,0 @@ }()); |
@@ -6,3 +6,3 @@ import { EventEmitter } from '@angular/core'; | ||
private sType; | ||
constructor(sType: STORAGE); | ||
constructor(sType?: STORAGE); | ||
store(raw: string, value: any): void; | ||
@@ -9,0 +9,0 @@ retrieve(raw: string): any; |
@@ -5,4 +5,5 @@ "use strict"; | ||
function WebStorageService(sType) { | ||
this.sType = null; | ||
if (sType === void 0) { sType = null; } | ||
this.sType = sType; | ||
this.sType = sType; | ||
} | ||
@@ -9,0 +10,0 @@ WebStorageService.prototype.store = function (raw, value) { |
{ | ||
"name": "ng2-webstorage", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "angular2 webstorage manager", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,3 +19,3 @@ # ng2-webstorage | ||
* [Helpers](#helpers): | ||
* [@KeyStorageHelper](#h_keystorage) | ||
* [KeyStorageHelper](#h_keystorage) | ||
* [Modify and build](#modifBuild) | ||
@@ -290,6 +290,6 @@ | ||
#### setStorageKeyPrefix( key:`string` ):`void` | ||
> set the string used as prefix in the storage's item names | ||
> set the string used as prefix in the storage's item names. | ||
##### Params: | ||
- **key**: String. prefix. | ||
- **key**: String. prefix. default to 'ng2-webstorage' | ||
@@ -304,3 +304,17 @@ ##### Usage: | ||
#### setStorageKeySeparator( separator:`string` ):`void` | ||
> set the string used as separator in the storage's item names | ||
##### Params: | ||
- **key**: String. prefix. default to '|' | ||
##### Usage: | ||
````typescript | ||
import {KeyStorageHelper} from 'ng2-webstorage'; | ||
KeyStorageHelper.setStorageKeySeparator('.'); | ||
```` | ||
### <a name="modifBuild">Modify and build</a> | ||
@@ -307,0 +321,0 @@ -------------------- |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43525
486
328