0

In my typescript file, I have these functions:

export {convertToArray, getColumn}


function convertToArray(fileName: string): StringTable {
  ...
}

function getColumn(columnName: string, table: StringTable): string[] {
  ...
}

And I'm trying to import them in another Typescript file:

import {convertToArray, getColumn} from './csv-reader'

But now it's telling me that my functions are declared locally but never exported.

1 Answer 1

1

That's because you exported them before defining them. Try with:

export function convertToArray(fileName: string): StringTable {
  ...
}

export function getColumn(columnName: string, table: StringTable): string[] {
  ...
}
Sign up to request clarification or add additional context in comments.

1 Comment

Same error.. Its a TypeError telling me that csv_reader_1.converToArray is not a function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.