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

object.d.ts: invalid TypeScript declarations #26

Closed
thetric opened this issue Apr 27, 2023 · 2 comments · Fixed by #27
Closed

object.d.ts: invalid TypeScript declarations #26

thetric opened this issue Apr 27, 2023 · 2 comments · Fixed by #27
Assignees
Labels
bug Something isn't working

Comments

@thetric
Copy link

thetric commented Apr 27, 2023

Describe the Bug

We can't use version 4.1.0 because it includes invalid TypeScript definitions:

Error: node_modules/min-dash/dist/object.d.ts:72:77 - error TS2344: Type 'V' does not satisfy the constraint 'keyof T'.
  Type 'any[]' is not assignable to type 'keyof T'.

72 export function pick<T, V extends any[]>(target: T, properties: V): Pick<T, V>;
                                                                               ~

Error: node_modules/min-dash/dist/object.d.ts:82:77 - error TS2344: Type 'V' does not satisfy the constraint 'string | number | symbol'.
  Type 'any[]' is not assignable to type 'string | number | symbol'.

82 export function omit<T, V extends any[]>(target: T, properties: V): Omit<T, V>;
                                                                               ~

This is introduced in #25.

Steps to Reproduce

Can also be reproduced in the TypeScript Playground: https://www.typescriptlang.org/play?ts=5.0.4#code/PQKhCgAIUhhB7ADgT0gFwBYFNIDcCGANgK5YDOk8AZpEYZTZjlgHbEC2WATvgEaE54AdxaREXJNzQBLcpCoT2lFoK6R28LjjLxiXAMaDeAKyz60FNPFpQYafFwDmWNJRNm0AOkgAlF3pZLbHQHZ1d4d3NPW1tIAAFEB3wleycXSAAVYNSwt1NzdGt9JFQraOh4xJ4lHT1DTODagyN81wV4JSEMaX0MQshilDEJRClZMnKQYHAsAA9ETTbiFnNpeFF8MjJpRxYAHgyAGkgAVQA+AAoclwAuTOOmwzuTgEo7jMgAMlOAbnBwUAQCoIIZMPBEUgUai0Qj0aFg1gcbh8ASUETDSRcGRydpKdaqdSabS6Zp5DyWaz4WLXcKRLy+fxcQLobKhdIRVqTWIJJIp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7H1MOdiNea+bYUu-IY45n0EhnUJxwG+6puhxgznpS3dunId4Xu+gblg7NyPoGIweyOHyg7AhqbwnrMKezoZ6lTKvPNAydX7kBXncPyQC0CbzONvYEskcDKyhIpWELYETtmRF2NEml4HhR1LpTQwVDLjjClOak5k6SWT7rZNynIO5rVyBbey7kIKeU9vBd0-lArUIMuxYy9dIr8OiqaN+UwEp-2RgAjszgMbZX6pAXKnh8pF3KqzYqPwgA

(copy&pasta of https://github.com/bpmn-io/min-dash/blob/master/lib/object.d.ts)

Expected Behavior

This library should provide valid TypeScript declarations.

Environment

  • Host (Browser/Node version), if applicable: Node 18.16.0, TypeScript 4.8.4
  • OS: Win 10
  • Library version: 4.1.0
@thetric thetric added the bug Something isn't working label Apr 27, 2023
nikku added a commit that referenced this issue Apr 27, 2023
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Apr 27, 2023
@fake-join fake-join bot closed this as completed in #27 Apr 27, 2023
fake-join bot pushed a commit that referenced this issue Apr 27, 2023
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Apr 27, 2023
@nikku
Copy link
Member

nikku commented Apr 27, 2023

Thanks for the report. Released fix with v4.1.1.

@thetric
Copy link
Author

thetric commented Apr 27, 2023

Wow, that was fast 🤯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants