@activecollab/components
Version:
ActiveCollab Components
10 lines • 410 B
JavaScript
/**
* Sanitizes a string by replacing non-breaking spaces and other special whitespace
* with standard spaces, then trims the result.
*/
export const sanitizeAndTrim = value => {
return value.replace(/\u00a0/g, " ") // Replace (\u00a0)
.replace(/\s+/g, " ") // Replace multiple whitespace with single space
.trim(); // Trim leading/trailing whitespace
};
//# sourceMappingURL=stringUtils.js.map