Skip to content

Commit

Permalink
Improve style
Browse files Browse the repository at this point in the history
  • Loading branch information
erikolson186 committed Feb 27, 2017
1 parent 402297c commit d69f15e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ class Collection {
const value = doc[field];

if (Array.isArray(value)) {
for (let element of value) { this._validate(element); }
for (let element of value) {
this._validate(element);
}
} else if (typeof value === 'object') {
this._validate(value);
}
Expand Down Expand Up @@ -97,14 +99,15 @@ class Collection {
this._db._getConn((error, idb) => {
let trans;

try {
trans = idb.transaction([this._name], 'readwrite');
} catch (error) { return deferred.reject(error); }
const name = this._name;

try { trans = idb.transaction([name], 'readwrite'); }
catch (error) { return deferred.reject(error); }

trans.oncomplete = () => deferred.resolve();
trans.onerror = e => deferred.reject(getIDBError(e));

const store = trans.objectStore(this._name);
const store = trans.objectStore(name);

let i = 0;

Expand Down

0 comments on commit d69f15e

Please sign in to comment.