From 96f23ab57136d452cdb3a9d3ce0ec64aa7d256f6 Mon Sep 17 00:00:00 2001 From: Simon Lindh Date: Mon, 20 Feb 2017 23:11:27 +0100 Subject: [PATCH] Avoid errors when running in strictNullChecks mode. (#29) --- src/app/pipes/helpers/helpers.ts | 2 +- src/app/pipes/object/invert-by.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pipes/helpers/helpers.ts b/src/app/pipes/helpers/helpers.ts index 223c1a44..c33a0778 100644 --- a/src/app/pipes/helpers/helpers.ts +++ b/src/app/pipes/helpers/helpers.ts @@ -36,5 +36,5 @@ export function extractDeepPropertyByMapKey(obj: any, map: string): any { return !isUndefined(prop) && !isUndefined(prop[key]) ? prop[key] : undefined; - }, obj[key]); + }, obj[key || '']); } diff --git a/src/app/pipes/object/invert-by.ts b/src/app/pipes/object/invert-by.ts index 3bba3fe2..d71ae54b 100644 --- a/src/app/pipes/object/invert-by.ts +++ b/src/app/pipes/object/invert-by.ts @@ -4,7 +4,7 @@ import {isObject} from '../helpers/helpers'; @Pipe({name: 'invertBy'}) export class InvertByPipe implements PipeTransform { - transform(obj: any, cb: Function = null): Object { + transform(obj: any, cb?: Function): Object { if (Array.isArray(obj) || !isObject(obj)) { return obj; }