Skip to content

Commit

Permalink
set options if falsy
Browse files Browse the repository at this point in the history
  • Loading branch information
gr0uch committed Aug 20, 2015
1 parent 6482727 commit 257255a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog


##### 1.1.0 (2015-08-20)
- Feature: pass request meta-data to adapters. Thanks [@avens19](https://github.com/avens19)!
- Revert: do run `prepublish` on install.


##### 1.0.5 (2015-08-19)
- Improvement: do not run `prepublish` script on install.

Expand Down
2 changes: 2 additions & 0 deletions lib/adapter/adapters/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { BadRequestError } from '../../common/errors'


export function applyOptions (count, fields, records, options) {
if (!options) options = {}

if ('match' in options) {
records = records.filter(matchByField.bind(null, fields, options.match))
count = records.length
Expand Down
2 changes: 1 addition & 1 deletion lib/adapter/adapters/indexeddb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default Adapter => class IndexedDBAdapter extends Adapter {
}


find (type, ids, options = {}) {
find (type, ids, options) {
if (ids && !ids.length) return super.find()

const { db, recordTypes } = this
Expand Down
1 change: 0 additions & 1 deletion lib/adapter/adapters/memory/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default Adapter => class MemoryAdapter extends Adapter {


find (type, ids, options) {
if (!options) options = {}
if (ids && !ids.length) return super.find()

const { db, recordTypes } = this
Expand Down
2 changes: 1 addition & 1 deletion lib/adapter/adapters/webstorage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default Adapter => class WebStorageAdapter extends Adapter {
}


find (type, ids, options = {}) {
find (type, ids, options) {
if (ids && !ids.length) return super.find()

const { store, recordTypes, options: { prefix } } = this
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"build:test": "mkdirp dist/test && babel test --out-dir dist/test",
"build:website": "babel-node website/build",
"lint": "eslint lib test website",
"prepublish": "not-in-install && npm run clean && npm run build",
"prepublish": "npm run clean && npm run build",
"postpublish": "npm run deploy:website",
"test": "npm run lint && npm run test:server && npm run test:browser",
"test:server": "npm run build && node dist/test | tap-dot",
Expand Down Expand Up @@ -52,7 +52,6 @@
"highlight.js": "^8.7.0",
"html-minifier": "^0.7.2",
"http-server": "^0.8.0",
"in-publish": "^2.0.0",
"isparta": "^3.0.3",
"marked": "^0.3.5",
"mkdirp": "^0.5.1",
Expand Down

0 comments on commit 257255a

Please sign in to comment.