Skip to content

Commit 5ba793c

Browse files
fix(guardInstance): guard the value with object
1 parent bd3e733 commit 5ba793c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/type/src/guard/lib/guard-instance.func.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import { ResultCallback } from '../../type/result-callback.type';
1111
* @param callback Optional `ResultCallback` function to handle result before returns.
1212
* @returns A `boolean` indicating whether or not the `value` is a `symbol`.
1313
*/
14-
export const guardInstance: GuardInstance = <Obj>(value: Obj, instance: Constructor<Obj>, callback?: ResultCallback): value is Obj =>
14+
export const guardInstance: GuardInstance = <Obj extends object>(value: Obj, instance: Constructor<Obj>, callback?: ResultCallback): value is Obj =>
1515
isInstance<Obj>(value, instance, callback);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { Constructor } from '../../type/constructor.type';
22
import { ResultCallback } from '../../type/result-callback.type';
3-
export type GuardInstance = <Obj>(value: Obj, instance: Constructor<Obj>, callback?: ResultCallback) => value is Obj;
3+
export type GuardInstance = <Obj extends object>(value: Obj, instance: Constructor<Obj>, callback?: ResultCallback) => value is Obj;

0 commit comments

Comments
 (0)