| 'use strict'; |
| |
| function createOpenDBFunction() { |
| if (typeof sqlitePlugin !== 'undefined') { |
| // The SQLite Plugin started deviating pretty heavily from the |
| // standard openDatabase() function, as they started adding more features. |
| // It's better to just use their "new" format and pass in a big ol' |
| // options object. |
| return sqlitePlugin.openDatabase.bind(sqlitePlugin); |
| } |
| |
| if (typeof openDatabase !== 'undefined') { |
| return function openDB(opts) { |
| // Traditional WebSQL API |
| return openDatabase(opts.name, opts.version, opts.description, opts.size); |
| }; |
| } |
| } |
| |
| export default createOpenDBFunction; |