From 3954244badf775646a590f53070c53142abcbc3e Mon Sep 17 00:00:00 2001 From: Gadi Cohen Date: Fri, 29 Jan 2021 16:48:40 +0200 Subject: [PATCH] fix(index): revert back to non-class re-export approach --- bin/yahoo-finance.js | 6 ++---- src/index.ts | 15 +-------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/bin/yahoo-finance.js b/bin/yahoo-finance.js index a280cf71..4e028fa0 100755 --- a/bin/yahoo-finance.js +++ b/bin/yahoo-finance.js @@ -1,8 +1,7 @@ #!/usr/bin/env node -const YahooFinance = require('../api/index.js').default; -const { modules } = require('../api/index.js'); -const moduleNames = Object.keys(modules); +const yahooFinance = require('../api/index.js'); +const moduleNames = Object.keys(yahooFinance); const node = process.argv[0]; const script = process.argv[1]; @@ -31,7 +30,6 @@ function decodeArgs(stringArgs) { (async function() { const args = decodeArgs(argsAsStrings); - const yahooFinance = new YahooFinance(); const result = await yahooFinance[moduleName](...args); if (process.stdout.isTTY) diff --git a/src/index.ts b/src/index.ts index 0f047cc1..90034e37 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,22 +3,9 @@ import historical from './modules/historical'; import quoteSummary from './modules/quoteSummary'; import search from './modules/search'; -export const modules = { +export { autoc, historical, quoteSummary, search, }; - - -class YahooFinance { - constructor() { - } - - autoc = autoc; - historical = historical; - quoteSummary = quoteSummary; - search = search; -} - -export default YahooFinance;