Skip to content

Commit 5ae64da

Browse files
Merge pull request #16 from angular-package/4.0.x
4.0.3
2 parents 419daf2 + 6332f4e commit 5ae64da

19 files changed

+608
-267
lines changed

README.md

Lines changed: 235 additions & 106 deletions
Large diffs are not rendered by default.

packages/type/README.md

Lines changed: 235 additions & 106 deletions
Large diffs are not rendered by default.

packages/type/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/type/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-package/type",
3-
"version": "4.0.2",
3+
"version": "4.0.3",
44
"description": "Common types, type guards and type checkers.",
55
"author": "Angular Package <[email protected]> (https://wvvw.dev)",
66
"homepage": "https://github.com/angular-package/type#readme",

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { ResultCallback } from '../../type/result-callback.type';
66
/**
77
* Guard the `value` to be an `object` of a generic `Obj` type that contains the `key`.
88
* @param value A generic `Obj` type `value` that contains the `key` to guard.
9-
* @param key A key of `Obj` or an array key of `Obj` type as the name of the property that the `value` contains.
9+
* @param key A key of `Obj` or an array of keys of `Obj` type as the name of the property that the `value` contains.
1010
* @param callback An optional `ResultCallback` function to handle result before returns.
1111
* @returns A `boolean` indicating whether or not the `value` is an `object` of a generic `Obj` containing the `key`.
1212
*/
1313
export const guardObjectKey: GuardObjectKey =
14-
<Obj = object>(value: Obj, key: keyof Obj | (keyof Obj)[], callback?: ResultCallback): value is Obj =>
14+
<Obj>(value: Obj, key: keyof Obj | (keyof Obj)[], callback?: ResultCallback): value is Obj =>
1515
isObjectKey<Obj>(value, key, callback);

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 = object>(value: Obj, callback?: ResultCallback): value is Obj =>
12+
export const guardObject: GuardObject = <Obj>(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 = object>(value: Obj, key: keyof Obj | (keyof Obj)[], callback?: ResultCallback) => value is Obj;
2+
export type GuardObjectKey = <Obj>(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 = object>(value: Obj, callback?: ResultCallback) => value is Obj;
2+
export type GuardObject = <Obj>(value: Obj, callback?: ResultCallback) => value is Obj;

packages/type/src/is/lib/is-array.func.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1111
* @callback `resultCallback`.
1212
* @returns A `boolean` indicating whether or not the `value` is an `Array`.
1313
*/
14-
export const isArray: IsArray = <Type>(value: any, callback: ResultCallback = resultCallback): value is Array<Type> =>
14+
export const isArray: IsArray = <Type = any>(value: any, callback: ResultCallback = resultCallback): value is Array<Type> =>
1515
callback(
1616
typeOf(value) === 'array' &&
1717
Array.isArray(value) === true &&

packages/type/src/is/lib/is-boolean.func.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1111
* @param value Any `value` to check.
1212
* @param callback `ResultCallback` function to handle result before returns.
1313
* @callback `resultCallback`.
14-
* @returns A `boolean` indicating whether or not the `value` is a `boolean` type or `Boolean` object.
14+
* @returns A `boolean` indicating whether or not the `value` is a `boolean` type or `Boolean` instance.
1515
*/
1616
export const isBoolean: IsBoolean = (value: any, callback: ResultCallback = resultCallback): value is boolean =>
1717
callback(typeOf(value) === 'boolean' && (isBooleanType(value) || isBooleanObject(value)), value);

0 commit comments

Comments
 (0)