Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Improved general helpers and added their funcs to flume index (sc2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
guerrato authored and arnemolland committed Oct 15, 2021
1 parent 0ae1522 commit 3835f71
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './lib/theme'
export * from './lib/components'
export * from './lib/hooks'
export * from './lib/helpers'
6 changes: 4 additions & 2 deletions src/lib/helpers/general.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export const isNullOrUndefined = (value: any) => {
return value === undefined || value === null
return value === undefined || value === null || typeof value === 'undefined'
}

export const isEmpty = (value: any) => {
return value === undefined || value === null || value.trim().length === 0
return isNullOrUndefined(value) || value.trim().length === 0
}

export default { isNullOrUndefined, isEmpty }
1 change: 1 addition & 0 deletions src/lib/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './general'

0 comments on commit 3835f71

Please sign in to comment.