Skip to content

Commit 75b1158

Browse files
Merge pull request #27 from angular-package/4.1.x
4.1.3 README.md
2 parents 288a6ab + 30de8f4 commit 75b1158

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

+735
-271
lines changed

README.md

Lines changed: 433 additions & 130 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ import { ResultCallback } from '../../type/result-callback.type';
99
* @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
*/
12-
export const guardArray: GuardArray = <Type>(value: Array<Type>, callback?: ResultCallback): value is Array<Type> =>
13-
isArray<Type>(value, callback);
12+
export const guardArray: GuardArray = <Type>(
13+
value: Array<Type>,
14+
callback?: ResultCallback
15+
): value is Array<Type> => isArray<Type>(value, callback);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ import { ResultCallback } from '../../type/result-callback.type';
99
* @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
*/
12-
export const guardBigInt: GuardBigInt = (value: bigint, callback?: ResultCallback): value is bigint =>
13-
isBigInt(value, callback);
12+
export const guardBigInt: GuardBigInt = (
13+
value: bigint,
14+
callback?: ResultCallback
15+
): value is bigint => isBigInt(value, callback);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1010
* @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
*/
13-
export const guardBoolean: GuardBoolean = <B extends AnyBoolean>(value: B, callback?: ResultCallback): value is B =>
14-
isBoolean(value, callback);
13+
export const guardBoolean: GuardBoolean = <B extends AnyBoolean>(
14+
value: B,
15+
callback?: ResultCallback
16+
): value is B => isBoolean(value, callback);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1010
* @returns A `boolean` indicating whether or not the `value` is a generic `class`.
1111
*/
1212
// tslint:disable-next-line: ban-types
13-
export const guardClass: GuardClass = <Class extends Function>(value: Class, callback?: ResultCallback): value is Class =>
14-
isClass<Class>(value, callback);
13+
export const guardClass: GuardClass = <Class extends Function>(
14+
value: Class,
15+
callback?: ResultCallback
16+
): value is Class => isClass<Class>(value, callback);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1010
* @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
*/
13-
export const guardDefined: GuardDefined = <Type>(value: Defined<Type>, callback?: ResultCallback): value is Defined<Type> =>
14-
isDefined(value, callback);
13+
export const guardDefined: GuardDefined = <Type>(
14+
value: Defined<Type>,
15+
callback?: ResultCallback
16+
): value is Defined<Type> => isDefined(value, callback);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1010
* @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
*/
13-
export const guardFunction: GuardFunction = (value: Func, callback?: ResultCallback): value is Func =>
14-
isFunction(value, callback);
13+
export const guardFunction: GuardFunction = (
14+
value: Func,
15+
callback?: ResultCallback
16+
): value is Func => isFunction(value, callback);

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { ResultCallback } from '../../type/result-callback.type';
1212
* @param callback An optional `ResultCallback` function to handle the result before returns.
1313
* @returns A `boolean` indicating whether or not the `value` is an `instance` of a generic `Obj`.
1414
*/
15-
export const guardInstance: GuardInstance =
16-
<Obj extends object>(value: Obj, constructor: Constructor<Obj>, callback?: ResultCallback): value is Obj =>
17-
isInstance<Obj>(value, constructor, callback);
15+
export const guardInstance: GuardInstance = <Obj extends object>(
16+
value: Obj,
17+
constructor: Constructor<Obj>,
18+
callback?: ResultCallback
19+
): value is Obj => isInstance<Obj>(value, constructor, callback);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ import { ResultCallback } from '../../type/result-callback.type';
1010
* @param callback An optional `ResultCallback` function to handle the result before returns.
1111
* @returns A `boolean` indicating whether or not the `value` is a `Key`.
1212
*/
13-
export const guardKey: GuardKey = (value: Key, callback?: ResultCallback): value is Key =>
14-
isKey(value, callback);
13+
export const guardKey: GuardKey = (
14+
value: Key,
15+
callback?: ResultCallback
16+
): value is Key => isKey(value, callback);

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ import { ResultCallback } from '../../type/result-callback.type';
99
* @param callback An optional `ResultCallback` function to handle the result before returns.
1010
* @returns A `boolean` indicating whether or not the `value` is a `null`.
1111
*/
12-
export const guardNull: GuardNull = (value: null, callback?: ResultCallback): value is null =>
13-
isNull(value, callback);
12+
export const guardNull: GuardNull = (
13+
value: null,
14+
callback?: ResultCallback
15+
): value is null => isNull(value, callback);

0 commit comments

Comments
 (0)