Skip to content

Commit

Permalink
Allow to use deprecated call to createObjectStore.
Browse files Browse the repository at this point in the history
  • Loading branch information
paberr committed Mar 16, 2018
1 parent ffcde0f commit 84ff5b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/platform/browser/JungleDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class JungleDB {
*/
createObjectStore(tableName, options=null, persistentArg=true) {
let { codec = null, persistent = persistentArg, upgradeCondition = null } = (typeof options === 'object' && options !== null) ? options : {};
if (typeof options !== 'object' && options !== null) codec = options;
if (typeof options === 'object' && options !== null && 'encode' in options && 'decode' in options) codec = options;

if (this._connected) throw new Error('Cannot create ObjectStore while connected');
if (this._objectStores.has(tableName)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/platform/nodejs/JungleDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class JungleDB {
*/
createObjectStore(tableName, options=null, persistentArg=true) {
let { codec = null, persistent = persistentArg, upgradeCondition = null } = (typeof options === 'object' && options !== null) ? options : {};
if (typeof options !== 'object' && options !== null) codec = options;
if (typeof options === 'object' && options !== null && 'encode' in options && 'decode' in options) codec = options;

if (this._connected) throw new Error('Cannot create ObjectStore while connected');
if (this._objectStores.has(tableName)) {
Expand Down

0 comments on commit 84ff5b7

Please sign in to comment.