UNPKG

@transferwise/neptune-validation

Version:
9 lines (7 loc) 295 B
import { isString, isObject, isArray } from '../type-validators'; /** * Checks empty values for arrays, objects and strings. */ export const isEmpty = (value: unknown) => (isString(value) && value.length === 0) || ((isObject(value) || isArray(value)) && Object.keys(value).length === 0);