all files / lib/collection/ index.js

100% Statements 16/16
100% Branches 8/8
100% Functions 2/2
100% Lines 10/10
1 branch Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14   43× 17× 26×   17×      
import FileSystemCollection from './type/file-system';
import MetadataCollection from './type/metadata';
import StaticCollection from './type/static';
 
export function createCollection(name, collectionConfig, getConfig) {
  if (collectionConfig.static) {
    return new StaticCollection(name, collectionConfig, getConfig);
  } else if (collectionConfig.metadata) {
    return new MetadataCollection(name, collectionConfig, getConfig);
  } else {
    return new FileSystemCollection(name, collectionConfig, getConfig);
  }
}