trim-x
Version:
This method removes whitespace from the left and right end of a string.
18 lines (15 loc) • 487 B
JavaScript
import trimStart from 'trim-left-x';
import trimEnd from 'trim-right-x';
/**
* This method removes whitespace from the start and end of a string.
* (ES2019).
*
* @param {string} [string] - The string to trim the whitespace from.
* @throws {TypeError} If string is null or undefined or not coercible.
* @returns {string} The trimmed string.
*/
var trim = function trim(string) {
return trimStart(trimEnd(string));
};
export default trim;
//# sourceMappingURL=trim-x.esm.js.map