Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typings): fix export #64

Merged
merged 1 commit into from
Jun 8, 2020
Merged

fix(typings): fix export #64

merged 1 commit into from
Jun 8, 2020

Conversation

EdJoPaTo
Copy link
Collaborator

@EdJoPaTo EdJoPaTo commented Jun 8, 2020

When the typescript compiler option esModuleInterop is enabled the current approach also works which is probably why this slipped through in #59.

fixes #63

After this fix usage for TypeScript (without esModuleInterop) is:

import * as LocalSession from 'telegraf-session-local'

With esModuleInterop enabled you can use it like this (which is why esModuleInterop exists as it wants to simplify importing JavaScript modules exported via module.export):

import LocalSession from 'telegraf-session-local'

session.js uses modules.exports = …
not modules.exports.default = …

both approaches work when esModuleInterop is enabled
but should also work without it
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b73bd02 on EdJoPaTo:typings-export into 6330622 on RealSpeaker:master.

@TemaSM TemaSM merged commit 24a80f8 into RealSpeaker:master Jun 8, 2020
@EdJoPaTo EdJoPaTo deleted the typings-export branch June 8, 2020 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error with Session version 1.0.3 with telegraf-js v 3.38
3 participants