From 67b3e1f7d8848a5447d9a6a4057e1f78ab0cc911 Mon Sep 17 00:00:00 2001 From: Paul Loyd Date: Sun, 17 Dec 2017 13:29:32 +0300 Subject: [PATCH] Export module API in CommonJS --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index ec97992..6f07d10 100644 --- a/src/index.js +++ b/src/index.js @@ -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;