Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
actra-gschuster committed May 15, 2018
1 parent 9341b3b commit f174cec
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v1.0.0
- Upgraded to immutable 4
- Upgraded to redux 4

### v0.2.1
- Fix filterObject() to apply filter() on immutables instead of using lodash.pickBy()

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function createTransform(dataToStorage, dataFromStorage, config = {}) {
const blacklist = isObject(config) && Array.isArray(config.blacklist) ? config.blacklist : null;

function whitelistBlacklistCheck(key) {
return (whitelist && !includes(whitelist, key)) || (blacklist && includes(blacklist, key));
return (whitelist && !includes(whitelist, key)) || (blacklist && !includes(blacklist, key));
}

function transformDataToStorage(state, key) {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"immutable"
],
"license": "MIT",
"version": "0.2.2",
"version": "1.0.0",
"author": {
"name": "Gabriel Schuster - actra.development",
"email": "[email protected]",
Expand All @@ -31,7 +31,7 @@
"access": "public"
},
"dependencies": {
"immutable": "^3.8.2",
"immutable": "^4.0.0-rc.9",
"lodash.forin": "^4.4.0",
"lodash.get": "^4.4.2",
"lodash.includes": "^4.3.0",
Expand All @@ -48,25 +48,25 @@
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.26.0",
"chai": "^4.1.2",
"mocha": "^4.0.1",
"mocha": "^5.1.1",
"mkdirp": "^0.5.1",
"redux": "^3.7.2",
"rimraf": "^2.6.1"
"redux": "^4.0.0",
"rimraf": "^2.6.2"
},
"peerDependencies": {
"immutable": "^3.8.2"
"immutable": "^4.0.0-rc.9"
},
"files": [
"dist"
],
"main": "dist/index.js",
"scripts": {
"test": "npm run-script mocha -- --require babel-register spec.js",
"build": "npm run-script rimraf -- ./dist && npm run-script mkdirp -- dist && npm run-script babel -- index.js -o dist/index.js",
"test": "npm run-script mocha -- --require babel-register spec.js",
"build": "npm run-script rimraf -- ./dist && npm run-script mkdirp -- dist && npm run-script babel -- index.js -o dist/index.js",
"release": "npm run-script test && npm run-script build && npm publish --access public",
"babel": "./node_modules/.bin/babel",
"mkdirp": "./node_modules/.bin/mkdirp",
"mocha": "./node_modules/.bin/mocha",
"rimraf": "./node_modules/.bin/rimraf"
"babel": "./node_modules/.bin/babel",
"mkdirp": "./node_modules/.bin/mkdirp",
"mocha": "./node_modules/.bin/mocha",
"rimraf": "./node_modules/.bin/rimraf"
}
}
12 changes: 6 additions & 6 deletions spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,21 @@ describe('redux-persist-transform-filter', () => {
const myFilter = createBlacklistFilter('reducerName', ['a.b', 'd']);

// simulates a save
const result1 = myFilter.transformDataToStorage({a: {b:'b', c:'c'}, d:'d'}, 'reducerName');
const result2 = myFilter.in({a: {b:'b', c:'c'}, d:'d'}, 'reducerName');
const result1 = myFilter.transformDataToStorage({a: {b: 'b', c: 'c'}, d: 'd'}, 'reducerName');
const result2 = myFilter.in({a: {b: 'b', c: 'c'}, d: 'd'}, 'reducerName');

expect(result1).to.deep.equal({a: {c:'c'}});
expect(result1).to.deep.equal({a: {c: 'c'}});
expect(result2).to.deep.equal(result1);
});

it('should load a subset', () => {
const myFilter = createBlacklistFilter('reducerName', undefined, ['a.b', 'd']);

// simulates a load
const result1 = myFilter.transformDataFromStorage({a: {b:'b', c:'c'}, d:'d'}, 'reducerName');
const result2 = myFilter.out({a: {b:'b', c:'c'}, d:'d'}, 'reducerName');
const result1 = myFilter.transformDataFromStorage({a: {b: 'b', c: 'c'}, d: 'd'}, 'reducerName');
const result2 = myFilter.out({a: {b: 'b', c: 'c'}, d: 'd'}, 'reducerName');

expect(result1).to.deep.equal({a: {c:'c'}});
expect(result1).to.deep.equal({a: {c: 'c'}});
expect(result2).to.deep.equal(result1);
});
});
Expand Down

0 comments on commit f174cec

Please sign in to comment.