Skip to content

Commit

Permalink
Merge pull request #466 from KaiVolland/function-typeguards
Browse files Browse the repository at this point in the history
Make function typeguards more failsafe
  • Loading branch information
KaiVolland authored Sep 5, 2022
2 parents 09d7ba2 + be9cf53 commit c30ab88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions typeguards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const isGeoStylerNumberFunction = (got: any): got is GeoStylerNumberFunct
'tan',
'toDegrees',
'toRadians'
].includes(got.name);
].includes(got?.name);
};

export const isGeoStylerStringFunction = (got: any): got is GeoStylerStringFunction => {
Expand All @@ -209,7 +209,7 @@ export const isGeoStylerStringFunction = (got: any): got is GeoStylerStringFunct
'strToLowerCase',
'strToUpperCase',
'strTrim'
].includes(got.name);
].includes(got?.name);
};

export const isGeoStylerBooleanFunction = (got: any): got is GeoStylerBooleanFunction => {
Expand All @@ -222,13 +222,13 @@ export const isGeoStylerBooleanFunction = (got: any): got is GeoStylerBooleanFun
'strEqualsIgnoreCase',
'strMatches',
'strStartsWith'
].includes(got.name);
].includes(got?.name);
};

export const isGeoStylerUnknownFunction = (got: any): got is GeoStylerUnknownFunction => {
return [
'property',
].includes(got.name);
].includes(got?.name);
};

export const isGeoStylerFunction = (got: any): got is GeoStylerFunction => {
Expand Down

0 comments on commit c30ab88

Please sign in to comment.