Skip to content

fix(saslprep): saslprep typing in node.d.ts NODE-5996 #254

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

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Mar 6, 2024

Description

the recent changes to make saslprep compatible with the browser changed the generated types for Nodejs. When we tried to consume the latest saslprep in the driver, we get compile errors.

It seems like the combination of _saslprep.bind and Object.assign erase the type of saslprep such that the generated .d.ts file doesn't accurately reflect the types.

node.d.ts before the changes in this PR:

declare const saslprep: (args_0: string, args_1?: {
    allowUnassigned?: boolean | undefined;
} | undefined) => string;
export = saslprep;
//# sourceMappingURL=node.d.ts.map

node.d.ts with the changes in this PR:

declare function saslprep(input: string, opts?: {
    allowUnassigned?: boolean;
}): string;
declare namespace saslprep {
    export var saslprep: typeof import("./node");
    var _a: typeof import("./node");
    export { _a as default };
}
export = saslprep;
//# sourceMappingURL=node.d.ts.map

Open Questions

Checklist

@baileympearson baileympearson marked this pull request as ready for review March 6, 2024 17:39
@baileympearson baileympearson changed the title fix(saslprep): saslprep typing in node.d.ts NODE-5963 fix(saslprep): saslprep typing in node.d.ts NODE-5996 Mar 6, 2024
@baileympearson baileympearson requested a review from nbbeeken March 6, 2024 17:45
@baileympearson baileympearson merged commit c04571d into main Mar 6, 2024
@baileympearson baileympearson deleted the NODE-5963-fix-saslprep-typing branch March 6, 2024 18:00
Copy link
Collaborator

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants