forked from thgreasi/localForage-cordovaSQLiteDriver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
302 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": [ "es2015-rollup" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"modules": true | ||
} | ||
}, | ||
"extends": "eslint:recommended", | ||
"env": { | ||
"node": true, | ||
"mocha": true | ||
}, | ||
"rules":{ | ||
"no-console": 0 | ||
}, | ||
"globals": { | ||
"localforage": true, | ||
"Promise": true, | ||
"console": true, | ||
"self": true, | ||
"System": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"esnext": true, | ||
"disallowSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true | ||
}, | ||
"disallowTrailingComma": true, | ||
"requireBlocksOnNewline": true, | ||
"requireLineFeedAtFileEnd": true, | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"return", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireSpacesInConditionalExpression": true, | ||
"requireSpacesInFunctionExpression": { | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"safeContextKeyword": ["globalObject", "self"], | ||
"validateQuoteMarks": { | ||
"escape": true, | ||
"mark": "'" | ||
}, | ||
"validateIndentation": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"asi": false, | ||
"bitwise": true, | ||
"browser": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
"esnext": true, | ||
"immed": true, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"nonew": true, | ||
"quotmark": false, | ||
"strict": false, | ||
"trailing": false, | ||
"undef": true, | ||
"unused": true, | ||
|
||
"validthis": true, | ||
|
||
"globals": { | ||
"console": true, | ||
"define": true, | ||
"localforage": true, | ||
"module": true, | ||
"Promise": true, | ||
"require": true, | ||
"self": true, | ||
"System": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
language: node_js | ||
node_js: | ||
- "4.0" | ||
- "5.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* global document, sqlitePlugin */ | ||
// we can't import this, since it gets defined later | ||
// import sqlitePlugin from 'sqlitePlugin'; | ||
|
||
var deviceReady = new Promise(function(resolve, reject) { | ||
if (typeof sqlitePlugin !== 'undefined') { | ||
resolve(); | ||
} else if (typeof cordova === 'undefined') { | ||
reject(); | ||
} else { | ||
// Wait for Cordova to load | ||
document.addEventListener("deviceready", resolve, false); | ||
} | ||
}); | ||
|
||
export var openDatabasePromise = deviceReady.catch(Promise.resolve).then(function() { | ||
return new Promise(function(resolve, reject) { | ||
if (typeof sqlitePlugin !== 'undefined' && | ||
typeof sqlitePlugin.openDatabase === 'function') { | ||
resolve(sqlitePlugin.openDatabase); | ||
} else { | ||
reject('SQLite plugin is not present.'); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.