lion/packages/ui/components/localize/number/utils/normalSpaces.js
2022-10-31 16:55:07 +01:00

8 lines
296 B
JavaScript

/**
* @param {string} value
* @returns {string} value with forced "normal" space
*/
export function normalSpaces(value) {
// If non-breaking space (160) or narrow non-breaking space (8239) then return ' '
return value.charCodeAt(0) === 160 || value.charCodeAt(0) === 8239 ? ' ' : value;
}