UNPKG

voca

Version:

The ultimate JavaScript string library

31 lines (27 loc) 637 B
import './internal/is_nil.js'; import './is_string.js'; import { c as coerceToString } from './internal/coerce_to_string.js'; /** * Checks whether `subject` is empty. * * @function isEmpty * @static * @since 1.0.0 * @memberOf Query * @param {string} [subject=''] The string to verify. * @return {boolean} Returns `true` if `subject` is empty or `false` otherwise * @example * v.isEmpty(''); * // => true * * v.isEmpty(' '); * // => false * * v.isEmpty('sun'); * // => false */ function isEmpty(subject) { var subjectString = coerceToString(subject); return subjectString.length === 0; } export default isEmpty;