File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,8 @@ pnpm add @utopia-utils/share
144144* isPlainObject
145145* isObject
146146* isIntegerKey
147+ * isUndef
148+ * isDef
147149* isEmpty [ source] ( https://github.com/GreatAuk/utopia-utils/blob/main/packages/share/src/isEmpty.ts )
148150* isNumberLike [ source] ( https://github.com/GreatAuk/utopia-utils/blob/main/packages/share/src/isNumberLike.ts )
149151* isValidUrl [ source] ( https://github.com/GreatAuk/utopia-utils/blob/main/packages/share/src/isValidUrl.ts )
Original file line number Diff line number Diff line change @@ -48,3 +48,7 @@ export const isStringNumber = (val: string): boolean => {
4848 return false
4949 return ! Number . isNaN ( Number ( val ) )
5050}
51+
52+ export const isDef = < T > ( val : T ) : val is NonNullable < T > => val !== undefined && val !== null
53+
54+ export const isUndef = ( val : any ) : val is ( undefined | null ) => val === undefined || val === null
You can’t perform that action at this time.
0 commit comments