Skip to content

Commit

Permalink
into [v0.0.45]
Browse files Browse the repository at this point in the history
  • Loading branch information
ilkhoeri committed Feb 4, 2025
1 parent f6b7b2c commit 1150459
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"prepare:test": "husky .husky/pre-publish \"yarn test\"",
"prepare": "husky",
"prepublishOnly": "npm run test && npm run build && npm run build:deno",
"jsr:publish": "cd deno/lib && npx jsr publish",
"jsr:publish": "yarn prettier && cd deno/lib && npx jsr publish",
"lint": "eslint src --cache",
"format": "prettier src",
"typecheck": "tsc --noEmit",
Expand Down
4 changes: 3 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
*
* @template T - The input type, which should ideally be a function.
* @returns The inferred return type of the function if `T` is a function type; otherwise, `never`.
*
* @example
* const MyFunction = () => {};
* type Result = inferType<typeof MyFunction>; // type Result = void.
* @see {@link https://ilkhoeri.github.io/cretex/types#infertype Docs}
*/
export type inferType<T> = T extends (...args: any[]) => infer R ? R : never;

0 comments on commit 1150459

Please # to comment.