Skip to content

Commit

Permalink
commitlint/fpHelpers: NonNullable in IsInstanceOf
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Sep 11, 2024
1 parent aed7a80 commit 3acbc1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commitlint/fpHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ 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) {
public static IsInstanceOf(variable: NonNullable<any>, type: NonNullable<any>) {
if (TypeHelpers.IsNullOrUndefined(variable)) {
throw new Error(
"Invalid 'variable' parameter passed in: null or undefined"
Expand Down

0 comments on commit 3acbc1d

Please sign in to comment.