Skip to content

Commit

Permalink
issue-#61 - Removed some generics in 'object/is' module.
Browse files Browse the repository at this point in the history
- Added tests scaffold for 'number/' module.
  • Loading branch information
elycruz committed Aug 28, 2022
1 parent 8eff8d9 commit 22919d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/fjl/src/object/is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ const
_WeakSet = 'WeakSet',
_Null = 'Null',
_Undefined = 'Undefined',
_immutable_type_names = [_String, _Number, _Boolean, _Symbol];
_immutable_type_names = [_String, _Number, _Boolean, _Symbol]
;



export const

/**
Expand Down Expand Up @@ -81,7 +79,7 @@ export const
* @param x {*}
* @returns {Boolean}
*/
isFunction = <T>(x: T): boolean => isset(x) && x instanceof Function,
isFunction = (x: any): boolean => isset(x) && x instanceof Function,

/**
* Strict type checker. Checks if given value is a direct instance of given type; E.g.,
Expand All @@ -100,10 +98,10 @@ export const
* @param obj {*}
* @return {Boolean}
*/
isType = <T>(type: TypeRef | any, obj: T): boolean => typeOf(obj) === toTypeRefName(type),
isType = (type: TypeRef | any, obj: any): boolean => typeOf(obj) === toTypeRefName(type),

$isType = <T>(type: TypeRef | any) =>
(obj: T): boolean => isType(type, obj),
$isType = (type: TypeRef | any) =>
(obj: any): boolean => isType(type, obj),

/**
* Synonym for `isType` (or just a more accurate name for `isType`).
Expand Down Expand Up @@ -267,7 +265,7 @@ export const
/**
* Checks if given `x` is set and of one of
* [String, Boolean, Number, Symbol] (null and undefined are immutable
* but are not "usable" (usually not what we want to operate on).
* but are not "usable" (e.g., usually not what we want to operate on etc.).
* @function module:object.isUsableImmutablePrimitive
* @param x {*}
* @returns {Boolean}
Expand Down
3 changes: 3 additions & 0 deletions packages/fjl/tests/number/index_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
describe('number/', () => {
it('should have more tests');
});

0 comments on commit 22919d7

Please sign in to comment.