UNPKG

stringzy

Version:

A versatile string manipulation library providing a range of text utilities for JavaScript and Node.js applications.

16 lines (15 loc) 546 B
"use strict"; /** * Checks whether a given string is empty or consists only of whitespace. * * Trims the input string and returns true if the resulting length is 0, * indicating that the string is either empty or contains only whitespace characters. * * @param {string} str - The string to check. * @returns {boolean} True if the string is empty or whitespace only, false otherwise. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.isEmpty = isEmpty; function isEmpty(str) { return str.trim().length === 0; }