node-argon2 icon indicating copy to clipboard operation
node-argon2 copied to clipboard

Fix: Add missing properties and correct types in Options typedef

Open Bluzzi opened this issue 1 year ago • 2 comments

Issue

  • close #403

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 avatar Jun 09 '24 16:06 Bluzzi

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

Bluzzi avatar Aug 02 '24 17:08 Bluzzi

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 avatar Aug 03 '24 08:08 ranisalt

The wrong buffer types have been fixed in v0.41.1

ranisalt avatar Aug 31 '24 22:08 ranisalt