From 81dfef3ec8e25e201d164f3c54be5fb6e6152a23 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 10 Sep 2024 01:12:37 +0800 Subject: [PATCH] WIP3 --- commitlint/fpHelpers.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commitlint/fpHelpers.ts b/commitlint/fpHelpers.ts index 5af094d2..477cc350 100644 --- a/commitlint/fpHelpers.ts +++ b/commitlint/fpHelpers.ts @@ -53,6 +53,9 @@ export class OptionStatic { export class TypeHelpers { // because instanceof doesn't work with primitive types (e.g. String), taken from https://stackoverflow.com/a/58184883/544947 public static IsInstanceOf(variable: any, type: any) { + if (variable === null || variable === undefined) { + throw new Error ("Invalid 'variable' parameter passed in: null or undefined"); + } let res: boolean = false; if (typeof type == "string") { res = typeof variable == type.toLowerCase();