-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Description
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch casual@1.6.2 for the project I'm working on.
Some of the functions could easily have their TS types improved by using generics.
Here is the diff that solved my problem:
diff --git a/node_modules/casual/index.d.ts b/node_modules/casual/index.d.ts
index b556860..b0098e5 100644
--- a/node_modules/casual/index.d.ts
+++ b/node_modules/casual/index.d.ts
@@ -282,7 +282,7 @@ declare namespace Casual {
define(type: string, cb: (...args: any[]) => any): void;
// HELPERS
- random_element(elements: Array<any>): any;
+ random_element<T>(elements: Array<T>): T;
random_value(obj: Object): any;
random_key(obj: Object): any;
populate(str: string): string;This issue body was partially generated by patch-package.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels