Skip to content

Correct glitch with type definitions #61

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FTWinston
Copy link

@FTWinston FTWinston commented May 27, 2020

The type definitions indicate that JSONPatcherProxy is a default export, but it isn't. It's a named export, so this PR just changes the type definition file to account for this.

Without this change, in typescript this shows no error:
import JSONPatcherProxy from 'jsonpatcherproxy';
but at runtime I get:
TypeError: jsonpatcherproxy_1.default is not a constructor

And if I try to use a named import:
import { JSONPatcherProxy } from 'jsonpatcherproxy';
I get a "has no exported member 'JSONPatcherProxy'" error.

With this change, the named imports satisfy typescript and work at runtime.

@FTWinston
Copy link
Author

Regarding the failed CI, the master branch is failing with the same error currently :)

@FTWinston FTWinston changed the title Corrected glitch with type definitions Correct glitch with type definitions May 27, 2020
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.

1 participant