Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
bumping version
Browse files Browse the repository at this point in the history
  • Loading branch information
tymondesigns committed Jan 18, 2015
1 parent 86d3ca7 commit 1967cbf
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ http://www.jsdelivr.com/#!angular.locker

Simply download the zip file [HERE](https://github.com/tymondesigns/angular-locker/archive/master.zip) and include `dist/angular-locker.min.js` in your project.

1.73 kB Minified & gzipped.
1.76 kB Minified & gzipped.

<h2 id="usage">Usage</h2>

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-locker",
"version": "1.0.3",
"version": "1.1.0",
"homepage": "https://github.com/tymondesigns/angular-locker",
"authors": [
"Sean Tymon <[email protected]>"
Expand Down
29 changes: 24 additions & 5 deletions dist/angular-locker.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
var defaults = {
driver: 'local',
namespace: 'locker',
eventsEnabled: true
eventsEnabled: true,
separator: '.'
};

return {
Expand Down Expand Up @@ -126,6 +127,24 @@
return defaults.eventsEnabled;
},

/**
* Set the separator to use with namespace in keys
*
* @param {String} separator
*/
setSeparator: function (separator) {
defaults.separator = _value(separator);

return this;
},

/**
* Get the separator
*/
getSeparator: function () {
return defaults.separator;
},

/**
* The locker service
*/
Expand All @@ -137,7 +156,7 @@
* @param {Storage} driver
* @param {String} namespace
*/
function Locker (driver, namespace, eventsEnabled) {
function Locker (driver, namespace, eventsEnabled, separator) {

/**
* @type {Object}
Expand Down Expand Up @@ -189,7 +208,7 @@
/**
* @type {String}
*/
this._separator = '.';
this._separator = separator;

/**
* @type {Object}
Expand Down Expand Up @@ -609,8 +628,8 @@
* @type {Object}
*/
var drivers = {
local: new Locker('local', defaults.namespace, defaults.eventsEnabled),
session: new Locker('session', defaults.namespace, defaults.eventsEnabled)
local: new Locker('local', defaults.namespace, defaults.eventsEnabled, defaults.separator),
session: new Locker('session', defaults.namespace, defaults.eventsEnabled, defaults.separator)
};

return drivers[defaults.driver];
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-locker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/angular-locker.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-locker",
"version": "1.0.3",
"version": "1.1.0",
"description": "A simple & configurable abstraction for local/session storage in angular projects",
"author": "@tymondesigns",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions src/angular-locker.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
* @param {Storage} driver
* @param {String} namespace
*/
function Locker (driver, namespace, eventsEnabled) {
function Locker (driver, namespace, eventsEnabled, separator) {

/**
* @type {Object}
Expand Down Expand Up @@ -208,7 +208,7 @@
/**
* @type {String}
*/
this._separator = defaults.separator;
this._separator = separator;

/**
* @type {Object}
Expand Down Expand Up @@ -628,8 +628,8 @@
* @type {Object}
*/
var drivers = {
local: new Locker('local', defaults.namespace, defaults.eventsEnabled),
session: new Locker('session', defaults.namespace, defaults.eventsEnabled)
local: new Locker('local', defaults.namespace, defaults.eventsEnabled, defaults.separator),
session: new Locker('session', defaults.namespace, defaults.eventsEnabled, defaults.separator)
};

return drivers[defaults.driver];
Expand Down

0 comments on commit 1967cbf

Please sign in to comment.