Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 44a552f

Browse files
committed
Avoid strictNullChecks errors
1 parent 291562c commit 44a552f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-pipes",
3-
"version": "6.1.1",
3+
"version": "6.1.2",
44
"description": "Angular pipes library",
55
"main": "src/index.js",
66
"jsnext:main": "esm/index.js",

src/string/with.pipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {isString, isNull} from '../utils/utils';
44
@Pipe({name: 'with'})
55
export class WithPipe implements PipeTransform {
66

7-
transform(input: string, start: string = null, ends: string = null, csensitive: boolean = false): any {
7+
transform(input: string, start: string|null = null, ends: string|null = null, csensitive: boolean = false): any {
88

99
if (!isString(input) || (isNull(start) && isNull(ends)) || (start == '') || (ends == '')) {
1010
return input;

src/utils/utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
export type CollectionPredicate = (item?: any, index?: number, collection?: any[]) => boolean;
22

3-
export function isUndefined (value: any): boolean {
3+
export function isUndefined (value: any): value is undefined {
44

55
return typeof value === 'undefined';
66
}
77

8-
export function isNull (value: any): boolean {
8+
export function isNull (value: any): value is null {
99

1010
return value === null;
1111
}
1212

13-
export function isNumber (value: any): boolean {
13+
export function isNumber (value: any): value is number {
1414

1515
return typeof value === 'number';
1616
}
1717

18-
export function isNumberFinite (value: any): boolean {
18+
export function isNumberFinite (value: any): value is number {
1919

2020
return isNumber(value) && isFinite(value);
2121
}
@@ -33,11 +33,11 @@ export function isInteger (value: number): boolean {
3333
return (value % 1) === 0;
3434
}
3535

36-
export function isNil (value: any): boolean {
36+
export function isNil (value: any): value is (null|undefined) {
3737
return value === null || typeof (value) === 'undefined';
3838
}
3939

40-
export function isString (value: any): boolean {
40+
export function isString (value: any): value is string {
4141

4242
return typeof value === 'string';
4343
}

0 commit comments

Comments
 (0)