Skip to content

Commit

Permalink
Stable Version 2.3.2
Browse files Browse the repository at this point in the history
Fixes #17
  • Loading branch information
jmdobry committed Dec 12, 2015
1 parent 6df4345 commit 3c6861a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
##### 2.3.2 - 12 December 2015

###### Backwards compatible bug fixes
- #17 - Id map clean-up

##### 2.3.0 - 24 November 2015

###### Backwards compatible API changes
Expand Down
14 changes: 9 additions & 5 deletions dist/js-data-localstorage.js
@@ -1,6 +1,6 @@
/*!
* js-data-localstorage
* @version 2.3.1 - Homepage <http://www.js-data.io/docs/dslocalstorageadapter>
* @version 2.3.2 - Homepage <http://www.js-data.io/docs/dslocalstorageadapter>
* @author Jason Dobry <jason.dobry@gmail.com>
* @copyright (c) 2014-2015 Jason Dobry
* @license MIT <https://github.com/js-data/js-data-localstorage/blob/master/LICENSE>
Expand Down Expand Up @@ -156,15 +156,19 @@ return /******/ (function(modules) { // webpackBootstrap
if (idsJson) {
ids = DSUtils.fromJson(idsJson);
} else {
this.storage.setItem(idsPath, DSUtils.toJson({}));
ids = {};
}
return ids;
}
}, {
key: 'saveKeys',
value: function saveKeys(ids, resourceConfig, options) {
this.storage.setItem(this.getPath(resourceConfig, options), DSUtils.toJson(ids));
var idsPath = this.getPath(resourceConfig, options);
if (!DSUtils.isEmpty(ids)) {
this.storage.setItem(idsPath, DSUtils.toJson(ids));
} else {
this.storage.removeItem(idsPath);
}
}
}, {
key: 'ensureId',
Expand Down Expand Up @@ -564,10 +568,10 @@ return /******/ (function(modules) { // webpackBootstrap
})();

DSLocalStorageAdapter.version = {
full: '2.3.1',
full: '2.3.2',
major: parseInt('2', 10),
minor: parseInt('3', 10),
patch: parseInt('1', 10),
patch: parseInt('2', 10),
alpha: true ? 'false' : false,
beta: true ? 'false' : false
};
Expand Down
4 changes: 2 additions & 2 deletions dist/js-data-localstorage.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js-data-localstorage.min.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "js-data-localstorage",
"description": "localStorage adapter for js-data.",
"version": "2.3.1",
"version": "2.3.2",
"homepage": "http://www.js-data.io/docs/dslocalstorageadapter",
"repository": {
"type": "git",
Expand Down Expand Up @@ -44,12 +44,12 @@
"js-data": "~2.x"
},
"devDependencies": {
"babel-core": "6.2.1",
"babel-core": "6.3.17",
"babel-eslint": "4.1.6",
"babel-loader": "6.2.0",
"babel-preset-es2015": "6.1.18",
"babel-preset-es2015": "6.3.13",
"codacy-coverage": "1.1.3",
"coveralls": "2.11.4",
"coveralls": "2.11.6",
"es6-promise": "3.0.2",
"js-data-adapter-tests": "~1.x",
"karma": "0.13.15",
Expand Down
8 changes: 6 additions & 2 deletions src/index.js
Expand Up @@ -76,14 +76,18 @@ class DSLocalStorageAdapter {
if (idsJson) {
ids = DSUtils.fromJson(idsJson)
} else {
this.storage.setItem(idsPath, DSUtils.toJson({}))
ids = {}
}
return ids
}

saveKeys (ids, resourceConfig, options) {
this.storage.setItem(this.getPath(resourceConfig, options), DSUtils.toJson(ids))
const idsPath = this.getPath(resourceConfig, options)
if (!DSUtils.isEmpty(ids)) {
this.storage.setItem(idsPath, DSUtils.toJson(ids))
} else {
this.storage.removeItem(idsPath)
}
}

ensureId (id, resourceConfig, options) {
Expand Down

0 comments on commit 3c6861a

Please sign in to comment.