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

TypeScript Declarations #27

Merged
merged 4 commits into from
May 9, 2022

Conversation

pvoisin
Copy link

@pvoisin pvoisin commented May 9, 2022

Here's an attempt to ship TypeScript declarations with the module so it can be used in TypeScript projects.

Also, while trying out existing code and browsing the source files I found little issues that I've fixed.

@pvoisin
Copy link
Author

pvoisin commented May 9, 2022

@dengelke - Whenever you have few minutes... :)

@dengelke
Copy link
Owner

dengelke commented May 9, 2022

Thanks @pvoisin will give it a look!

lib/record.js Outdated
@@ -8,11 +8,12 @@ function Record(record) {

Record.prototype = {
get: function (type) {
return this._record.get(type);
return this._record?.get(type);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this syntax breaks older versions of node.js, see failing tests

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, snap! Let me change this to something backward-compatible then...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just remade the commit - hopefully it works now!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for resolving

@pvoisin pvoisin force-pushed the feature/typescript-support branch from e27d9ad to 922e25a Compare May 9, 2022 15:57
@dengelke dengelke merged commit 2fdeee7 into dengelke:master May 9, 2022
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.

2 participants