angular2-locker
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -223,2 +223,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var defaultDriverType = arguments.length <= 1 || arguments[1] === undefined ? exports.DRIVERS.SESSION : arguments[1]; | ||
var namespaceSeparator = arguments.length <= 2 || arguments[2] === undefined ? ':' : arguments[2]; | ||
@@ -229,4 +230,5 @@ _classCallCheck(this, LockerConfig); | ||
this.defaultDriverType = defaultDriverType; | ||
this.namespaceSeparator = namespaceSeparator; | ||
}; | ||
LockerConfig = __decorate([core_1.Injectable(), __param(0, core_1.Optional()), __param(1, core_1.Optional()), __metadata('design:paramtypes', [String, Driver_1.Driver])], LockerConfig); | ||
LockerConfig = __decorate([core_1.Injectable(), __param(0, core_1.Optional()), __param(1, core_1.Optional()), __param(2, core_1.Optional()), __metadata('design:paramtypes', [String, Driver_1.Driver, String])], LockerConfig); | ||
exports.LockerConfig = LockerConfig; | ||
@@ -240,4 +242,5 @@ var Locker_1 = void 0; | ||
var defaultDriverType = lockerConfig.defaultDriverType; | ||
var namespaceSeparator = lockerConfig.namespaceSeparator; | ||
this.setNamespace(driverNamespace); | ||
this.setNamespace(driverNamespace, namespaceSeparator); | ||
this.driver = defaultDriverType.isSupported() ? defaultDriverType : exports.DRIVERS.MEMORY; | ||
@@ -250,4 +253,6 @@ } | ||
var namespace = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; | ||
var separator = arguments.length <= 1 || arguments[1] === undefined ? ':' : arguments[1]; | ||
this.namespace = namespace; | ||
this.separator = separator; | ||
} | ||
@@ -259,3 +264,4 @@ }, { | ||
defaultDriverType: driver.isSupported() ? driver : exports.DRIVERS.MEMORY, | ||
driverNamespace: this.namespace | ||
driverNamespace: this.namespace, | ||
namespaceSeparator: this.separator | ||
}); | ||
@@ -296,3 +302,3 @@ } | ||
value: function _makeKey(key) { | ||
return this.namespace ? this.namespace + ":" + key : key; | ||
return this.namespace ? "" + this.namespace + this.separator + key : key; | ||
} | ||
@@ -299,0 +305,0 @@ }]); |
{ | ||
"name": "angular2-locker", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"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", |
@@ -24,2 +24,7 @@ angular2-locker | ||
// LockerConfig also has an optional namespace separator (defaults to :) | ||
bootstrap(App, [provide(LockerConfig, { | ||
useValue: new LockerConfig('MyNamespace', Locker.DRIVERS.LOCAL, '.') // Values will be stored as **MyNamespace.myKey** | ||
})), Locker]) | ||
class App { | ||
@@ -26,0 +31,0 @@ constructor(private locker: Locker) {} |
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
67574
1457
80