Skip to content

Commit 98a0a54

Browse files
deskohdaffl
authored andcommitted
Updated typings for iff and isNot (#513)
1 parent 0530c56 commit 98a0a54

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

types/index.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ export function validateSchema(schema: object, ajv: AjvOrNewable, options?: Vali
493493
* Execute one array of hooks or another based on a sync or async predicate.
494494
* {@link https://feathers-plus.github.io/v1/feathers-hooks-common/index.html#IffElse}
495495
*/
496-
export function iffElse(predicate: PredicateFn, hooksTrue: Hook | Hook[], hooksFalse: Hook | Hook[]): Hook;
496+
export function iffElse(predicate: boolean | PredicateFn, hooksTrue: Hook | Hook[], hooksFalse: Hook | Hook[]): Hook;
497497

498498
export interface IffHook extends Hook {
499499
else(...hooks: Hook[]): Hook;
@@ -503,7 +503,7 @@ export interface IffHook extends Hook {
503503
* Execute one or another series of hooks depending on a sync or async predicate.
504504
* {@link https://feathers-plus.github.io/v1/feathers-hooks-common/index.html#Iff}
505505
*/
506-
export function iff(predicate: PredicateFn, ...hooks: Hook[]): IffHook;
506+
export function iff(predicate: boolean | PredicateFn, ...hooks: Hook[]): IffHook;
507507

508508
/**
509509
* Alias for iff
@@ -533,4 +533,5 @@ export function every(...predicates: PredicateFn[]): AsyncPredicateFn;
533533
* Negate a sync or async predicate function.
534534
* {@link https://feathers-plus.github.io/v1/feathers-hooks-common/index.html#IsNot}
535535
*/
536-
export function isNot(predicate: PredicateFn): AsyncPredicateFn;
536+
537+
export function isNot(predicate: boolean | PredicateFn): AsyncPredicateFn;

0 commit comments

Comments
 (0)