We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Type
Defined<Type>
1 parent ae7fd5d commit 0502369Copy full SHA for 0502369
2 files changed
packages/type/src/guard/lib/guard-defined.func.ts
@@ -11,4 +11,4 @@ import { ResultCallback } from '../../type/result-callback.type';
11
* @returns A `boolean` indicating whether or not the `value` is defined, if `undefined` then returns `never`.
12
*/
13
export const guardDefined: GuardDefined = <Type>(value: Type, callback?: ResultCallback): value is Defined<Type> =>
14
- isDefined(value, callback);
+ isDefined<Type>(value, callback);
packages/type/src/is/type/is-defined.type.ts
@@ -1,2 +1,3 @@
1
+import { Defined } from '../../type/defined.type';
2
import { ResultCallback } from '../../type/result-callback.type';
-export type IsDefined = (value: unknown, callback?: ResultCallback) => boolean;
3
+export type IsDefined = <Type>(value: unknown, callback?: ResultCallback) => value is Defined<Type>;
0 commit comments