Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "if-const", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "Executes blocks of code depending on thruthness of the value, while also making the value accessible to the block", |
@@ -8,3 +8,3 @@ export type Falsy = null | undefined | false | 0 | ''; | ||
type FT<T, R> = (...args: FP<T, R>) => T | R; | ||
type FT<T, R> = (...args: FP<T, R>) => R; | ||
@@ -18,3 +18,3 @@ export function ifConst<T>(cond: T): { | ||
export function ifConst<T, R>(cond: T, f?: F<T, R>, elf?: ELF<T, R>): R | undefined; | ||
export function ifConst<T, R = never>(cond: T, ...args: FP<T, R>): T | R | undefined | FT<T, R> { | ||
export function ifConst<T, R = never>(cond: T, ...args: FP<T, R>): R | undefined | FT<T, R> { | ||
return args[0] | ||
@@ -21,0 +21,0 @@ ? (cond ? args[0] : args[1])?.(cond as any) |
Sorry, the diff of this file is not supported yet
18214