UNPKG

d2-ui

Version:
16 lines (15 loc) 648 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = stringTrim; /** * Removes all spaces before first after last text char. * * @param {string} str The string to operate on * @returns {string} The resulting string. */ function stringTrim(str) { return str.replace(/^[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+|[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]+$/g, ''); } //# sourceMappingURL=stringTrim.js.map