Remove unused createCollection
This commit is contained in:
parent
c67c2a858a
commit
1f8556b049
1 changed files with 0 additions and 21 deletions
|
@ -1,6 +1,3 @@
|
|||
const isFunction = require('lodash/isFunction');
|
||||
const isObject = require('lodash/isObject');
|
||||
const isString = require('lodash/isString');
|
||||
const last = require('lodash/last');
|
||||
|
||||
const { runMigrations } = require('./run_migrations');
|
||||
|
@ -153,24 +150,6 @@ const database = {
|
|||
exports.run = ({ Backbone } = {}) =>
|
||||
runMigrations({ Backbone, database });
|
||||
|
||||
exports.createCollection = ({ Backbone, storeName }) => {
|
||||
if (!isObject(Backbone) || !isObject(Backbone.Collection) ||
|
||||
!isFunction(Backbone.Collection.extend)) {
|
||||
throw new TypeError('"Backbone" is required');
|
||||
}
|
||||
|
||||
if (!isString(storeName)) {
|
||||
throw new TypeError('"database" is required');
|
||||
}
|
||||
|
||||
const collection = new (Backbone.Collection.extend({
|
||||
database,
|
||||
storeName,
|
||||
}))();
|
||||
|
||||
return collection;
|
||||
};
|
||||
|
||||
exports.getDatabase = () => ({
|
||||
name: database.id,
|
||||
version: last(migrations).version,
|
||||
|
|
Loading…
Reference in a new issue