Skip to content

Commit ae7fd5d

Browse files
refactor: assign object instead of extends
1 parent e74f138 commit ae7fd5d

7 files changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ import { ResultCallback } from '../../type/result-callback.type';
99
* @param callback An optional `ResultCallback` function to handle result before returns.
1010
* @returns A `boolean` indicating whether or not the `value` is an `object` of a generic `Obj`.
1111
*/
12-
export const guardObject: GuardObject = <Obj extends object>(value: Obj, callback?: ResultCallback): value is Obj =>
12+
export const guardObject: GuardObject = <Obj = object>(value: Obj, callback?: ResultCallback): value is Obj =>
1313
isObject<Obj>(value, callback);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { ResultCallback } from '../../type/result-callback.type';
2-
export type GuardObjectKey = <Obj extends object>(value: Obj, key: keyof Obj | (keyof Obj)[], callback?: ResultCallback) => value is Obj;
2+
export type GuardObjectKey = <Obj = object>(value: Obj, key: keyof Obj | (keyof Obj)[], callback?: ResultCallback) => value is Obj;
33

44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
import { ResultCallback } from '../../type/result-callback.type';
2-
export type GuardObject = <Obj extends object>(value: Obj, callback?: ResultCallback) => value is Obj;
2+
export type GuardObject = <Obj = object>(value: Obj, callback?: ResultCallback) => value is Obj;

packages/type/src/is/lib/is-object-key-in.func.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1515
* @callback `resultCallback`.
1616
* @returns A `boolean` indicating whether or not the `value` is an `object` with the keys.
1717
*/
18-
export const isObjectKeyIn: IsObjectKeyIn = <Type extends object>(
18+
export const isObjectKeyIn: IsObjectKeyIn = <Type = object>(
1919
value: any,
2020
key: Key | Key[],
2121
callback: ResultCallback = resultCallback

packages/type/src/is/lib/is-object-key.func.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1515
* @callback `resultCallback`.
1616
* @returns A `boolean` indicating whether or not the `value` is an `object` with its own specified keys.
1717
*/
18-
export const isObjectKey: IsObjectKey = <Type extends object>(
18+
export const isObjectKey: IsObjectKey = <Type = object>(
1919
value: any,
2020
key: Key | Key[],
2121
callback: ResultCallback = resultCallback
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { Key } from '../../type/key.type';
22
import { ResultCallback } from '../../type/result-callback.type';
3-
export type IsObjectKeyIn = <Type extends object>(value: any, key: Key | Key[], callback?: ResultCallback) => value is Type;
3+
export type IsObjectKeyIn = <Type = object>(value: any, key: Key | Key[], callback?: ResultCallback) => value is Type;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { Key } from '../../type/key.type';
22
import { ResultCallback } from '../../type/result-callback.type';
3-
export type IsObjectKey = <Type extends object>(value: any, key: Key | Key[], callback?: ResultCallback) => value is Type;
3+
export type IsObjectKey = <Type = object>(value: any, key: Key | Key[], callback?: ResultCallback) => value is Type;

0 commit comments

Comments
 (0)