UNPKG

has-content

Version:

Returns true if the given value has meaningful content.

34 lines 1.09 kB
/** @module has-content */ declare module "has-content" { /** * Returns `false` if the given value is truthy or has any kind of content * @example * import {isEmpty} from "has-content" * const result = hasContent(" ") * result === true * @example * import {isEmpty} from "has-content" * const result = hasContent("a") * result === false * @function isEmpty * @param {*} value * @returns {boolean} `false` if `value` is truthy or has content, `true` otherwise */ export function isEmpty(value: any): boolean; /** * Returns `true` if the given value is truthy or has any kind of content * @example * import hasContent from "has-content" * const result = hasContent(" ") * result === false * @example * import hasContent from "has-content" * const result = hasContent("a") * result === true * @function default * @param {*} value * @returns {boolean} `true` if `value` is truthy or has content */ export default function(value: any): boolean; }