Export module API in CommonJS

master
Paul Loyd 2017-12-17 13:29:32 +03:00
parent 81dd63bd95
commit 67b3e1f7d8
1 changed files with 4 additions and 1 deletions

View File

@ -7,7 +7,7 @@ import type {Schema} from './generators/jsonSchema';
// @see babel#6805.
//export {Parser, Collector};
export default function (path: string): {+types: Type[], +schema: Schema} {
function collect(path: string): {+types: Type[], +schema: Schema} {
const parser = new Parser;
const collector = new Collector(parser);
@ -20,3 +20,6 @@ export default function (path: string): {+types: Type[], +schema: Schema} {
schema: generateJsonSchema(fund),
};
}
// Export in CommonJS for the users.
module.exports = collect;