Skip to content

Commit 25cc247

Browse files
Merge pull request #25 from angular-package/4.1.x
4.1.3
2 parents 951c409 + fde95d0 commit 25cc247

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+713
-396
lines changed

README.md

Lines changed: 549 additions & 312 deletions
Large diffs are not rendered by default.

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.

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.1.2",
3+
"version": "4.1.3",
44
"description": "Common types, type guards and type checkers.",
55
"author": "Angular Package <angular-package@wvvw.dev> (https://wvvw.dev)",
66
"homepage": "https://github.com/angular-package/type#readme",

src/guard/lib/guard-array.func.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { GuardArray } from '../type/guard-array.type';
55
import { ResultCallback } from '../../type/result-callback.type';
66
/**
77
* Guard the `value` to be an `Array` of a generic `Type`.
8-
* @param value A generic `Type` `Array` `value` to guard.
9-
* @param callback An optional `ResultCallback` function to handle result before returns.
8+
* @param value An `Array` of a generic `Type`, by default type detected from the `value` - to guard.
9+
* @param callback An optional `ResultCallback` function to handle the result before returns.
1010
* @returns A `boolean` indicating whether or not the `value` is an `Array` of a generic `Type`.
1111
*/
1212
export const guardArray: GuardArray = <Type>(value: Array<Type>, callback?: ResultCallback): value is Array<Type> =>

src/guard/lib/guard-big-int.func.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ResultCallback } from '../../type/result-callback.type';
66
/**
77
* Guard the `value` to be a `bigint`.
88
* @param value A `bigint` type `value` to guard.
9-
* @param callback Optional `ResultCallback` function to handle result before returns.
9+
* @param callback An optional `ResultCallback` function to handle the result before returns.
1010
* @returns A `boolean` indicating whether or not the `value` is a `bigint`.
1111
*/
1212
export const guardBigInt: GuardBigInt = (value: bigint, callback?: ResultCallback): value is bigint =>

src/guard/lib/guard-boolean.func.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { GuardBoolean } from '../type/guard-boolean.type';
66
import { ResultCallback } from '../../type/result-callback.type';
77
/**
88
* Guard the `value` to be any type of a boolean.
9-
* @param value An `AnyBoolean` type from the `value` to guard.
10-
* @param callback An optional `ResultCallback` function to handle result before returns.
9+
* @param value An `AnyBoolean` type `value`, by default of type detected from the `value` - to guard.
10+
* @param callback An optional `ResultCallback` function to handle the result before returns.
1111
* @returns A `boolean` indicating whether or not the `value` is a `boolean` type or `Boolean` object.
1212
*/
1313
export const guardBoolean: GuardBoolean = <B extends AnyBoolean>(value: B, callback?: ResultCallback): value is B =>

src/guard/lib/guard-class.func.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { GuardClass } from '../type/guard-class.type';
55
import { ResultCallback } from '../../type/result-callback.type';
66
/**
77
* Guard the `value` to be a generic `Class` type of `class`.
8-
* @param value A generic `Class` type from the `value` to guard.
9-
* @param callback An Optional `ResultCallback` function to handle result before returns.
8+
* @param value A `Function` type `value`, by default of a generic `Class` type detected from the `value` to guard.
9+
* @param callback An optional `ResultCallback` function to handle the result before returns.
1010
* @returns A `boolean` indicating whether or not the `value` is a generic `class`.
1111
*/
12+
// tslint:disable-next-line: ban-types
1213
export const guardClass: GuardClass = <Class extends Function>(value: Class, callback?: ResultCallback): value is Class =>
1314
isClass<Class>(value, callback);

src/guard/lib/guard-defined.func.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { GuardDefined } from '../type/guard-defined.type';
66
import { ResultCallback } from '../../type/result-callback.type';
77
/**
88
* Guard the `value` to be defined, not `undefined`.
9-
* @param value A generic `Type` type from the `value` to guard.
10-
* @param callback An optional `ResultCallback` function to handle result before returns.
9+
* @param value A generic type `value`, by default of `Defined<Type>` type detected from the `value` to guard against `undefined`.
10+
* @param callback An optional `ResultCallback` function to handle the result before returns.
1111
* @returns A `boolean` indicating whether or not the `value` is defined, if `undefined` then returns `never`.
1212
*/
1313
export const guardDefined: GuardDefined = <Type>(value: Defined<Type>, callback?: ResultCallback): value is Defined<Type> =>

src/guard/lib/guard-function.func.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ResultCallback } from '../../type/result-callback.type';
77
/**
88
* Guard the `value` to be a `Func` type.
99
* @param value A `Func` type `value` to guard.
10-
* @param callback Optional `ResultCallback` function to handle result before returns.
10+
* @param callback An optional `ResultCallback` function to handle the result before returns.
1111
* @returns A `boolean` indicating whether or not the `value` is a `Func`.
1212
*/
1313
export const guardFunction: GuardFunction = (value: Func, callback?: ResultCallback): value is Func =>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { GuardInstance } from '../type/guard-instance.type';
66
import { ResultCallback } from '../../type/result-callback.type';
77
/**
88
* Guard the `value` to be an `object` of a generic `Obj` type and an instance of `Constructor` type.
9-
* @param value A generic `Obj` type `value` to be an instance of the `constructor`.
9+
* @param value An `object`, by default of a generic `Obj` type detected from the `value`
10+
* to guard and check if it's a `constructor` instance.
1011
* @param constructor A class or function that specifies the type of the `constructor`.
1112
* @param callback An optional `ResultCallback` function to handle the result before returns.
1213
* @returns A `boolean` indicating whether or not the `value` is an `instance` of a generic `Obj`.

0 commit comments

Comments
 (0)