diff --git a/src/index.ts b/src/index.ts index f39369dc..b0c8537e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,4 @@ export * from './lib/theme' export * from './lib/components' export * from './lib/hooks' +export * from './lib/helpers' diff --git a/src/lib/helpers/general.ts b/src/lib/helpers/general.ts index 7ba94548..9643dbe8 100644 --- a/src/lib/helpers/general.ts +++ b/src/lib/helpers/general.ts @@ -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 } diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts new file mode 100644 index 00000000..94c91d07 --- /dev/null +++ b/src/lib/helpers/index.ts @@ -0,0 +1 @@ +export * from './general'