Skip to content

Commit

Permalink
merge issues :)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-gawron committed Jun 16, 2016
1 parent b7e0d6a commit 95f6810
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/main/sources/VcfDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,15 @@ function createFromVcfFile(remoteSource: VcfFile): VcfDataSource {
return o;
}

function create(data: Object): VcfDataSource {
var url = data.url;
var content = data.content;
if (url!==null && url!== undefined) {
function create(data: {url?: string, content?: string}): VcfDataSource {
var {url, content} = data;
if (url) {
return createFromVcfFile(new VcfFile(new RemoteFile(url)));
}
if (content!==null && content!== undefined) {
} else if (content) {
return createFromVcfFile(new VcfFile(new LocalStringFile(content)));
}
throw new Error(`Missing URL from track: ${JSON.stringify(data)}`);
}

function create(data: {url?: string, content?: string}): VcfDataSource {
var {url, content} = data;
if (url) {
return createFromVcfFile(new VcfFile(new RemoteFile(url)));
} else if (content) {
return createFromVcfFile(new VcfFile(new LocalStringFile(content)));
}
// If no URL or content is passed, fail
throw new Error(`Missing URL or content from track: ${JSON.stringify(data)}`);
// If no URL or content is passed, fail
throw new Error(`Missing URL or content from track: ${JSON.stringify(data)}`);
}

module.exports = {
Expand Down

0 comments on commit 95f6810

Please sign in to comment.