angular2-locker
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -121,7 +121,7 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var driverNamespace = lockerConfig.driverNamespace; | ||
this.lockerConfig = lockerConfig; | ||
var defaultDriverType = lockerConfig.defaultDriverType; | ||
var namespaceSeparator = lockerConfig.namespaceSeparator; | ||
this.setNamespace(driverNamespace, namespaceSeparator); | ||
this.setNamespace(); | ||
this.setSeparator(); | ||
this.driver = defaultDriverType.isSupported() ? defaultDriverType : Driver_1.DRIVERS.MEMORY; | ||
@@ -132,4 +132,12 @@ } | ||
key: "setNamespace", | ||
value: function setNamespace(namespace, separator) { | ||
value: function setNamespace() { | ||
var namespace = arguments.length <= 0 || arguments[0] === undefined ? this.lockerConfig.driverNamespace : arguments[0]; | ||
this.namespace = namespace; | ||
} | ||
}, { | ||
key: "setSeparator", | ||
value: function setSeparator() { | ||
var separator = arguments.length <= 0 || arguments[0] === undefined ? this.lockerConfig.namespaceSeparator : arguments[0]; | ||
this.separator = separator; | ||
@@ -136,0 +144,0 @@ } |
@@ -23,7 +23,2 @@ export interface IStorage { | ||
export abstract class AbstractLockerConfig { | ||
public driverNamespace: string | ||
public defaultDriverType: Driver | ||
} | ||
export class MemoryStorage implements IStorage { | ||
@@ -59,4 +54,5 @@ hasOwnProperty(key: any): boolean | ||
defaultDriverType: Driver | ||
namespaceSeparator: string | ||
constructor(driverNamespace?: string, defaultDriverType?: Driver) | ||
constructor(driverNamespace?: string, defaultDriverType?: Driver, namespaceSeparator?: string) | ||
} | ||
@@ -75,2 +71,3 @@ | ||
setNamespace(namespace?: string): void | ||
setSeparator(separator?: string): void | ||
useDriver(driver: Driver): Locker | ||
@@ -77,0 +74,0 @@ set(key: any, data: any, expiry?: any): void |
{ | ||
"name": "angular2-locker", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "angular2 library for managing session and locker storage, has backup for inmemory if neither are supported", | ||
@@ -5,0 +5,0 @@ "main": "dist/locker.js", |
@@ -74,3 +74,9 @@ angular2-locker | ||
`locker.setNamespace('myName')` | ||
`locker.setNamespace()` - Resets to lockerConfig default | ||
####`setSeparator` | ||
`locker.setSeparator('-')` | ||
`locker.setSeparator()` - Resets to lockerConfig default | ||
####`useDriver` | ||
@@ -77,0 +83,0 @@ ```typescript |
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
70507
1503
104