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: Add missing properties and correct types in Options typedef #408

Closed
wants to merge 1 commit into from

Conversation

Bluzzi
Copy link

@Bluzzi Bluzzi commented Jun 9, 2024

Issue

Remarks

  • saltLength no longer exists
    • added to JSdoc Options
  • the type of salt is any | undefined instead of Buffer | undefined
    • is generated correctly when I run tsc (npm run prepare)
  • the type of associatedData is any | undefined instead of Buffer | undefined
    • is generated correctly when I run tsc (npm run prepare)
  • the type of secret is any | undefined instead of Buffer | undefined
    • is generated correctly when I run tsc (npm run prepare)

Generated type

// argon2.d.cts
export type Options = {
    hashLength?: number | undefined;
    timeCost?: number | undefined;
    memoryCost?: number | undefined;
    parallelism?: number | undefined;
    type?: 0 | 2 | 1 | undefined;
    version?: number | undefined;
    salt?: Buffer | undefined;
    associatedData?: Buffer | undefined;
    secret?: Buffer | undefined;
    saltLength?: number | undefined;
};

@Bluzzi
Copy link
Author

Bluzzi commented Aug 2, 2024

Are there any blocking points on your side @ranisalt that still prevent the correction of this issue? Don't hesitate if you need help

@ranisalt
Copy link
Owner

ranisalt commented Aug 3, 2024

saltLength is not an option anymore, so it should not be present in the options type

The types of salt, associatedData and secret also generate properly as Buffer | undefined for me, the issue is in CI when they are generated before publishing. We need to investigate that further

@ranisalt
Copy link
Owner

The wrong buffer types have been fixed in v0.41.1

@ranisalt ranisalt closed this Aug 31, 2024
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.

Type regression between v0.31.2 and v0.40.1
2 participants