yoastseo
Version:
Yoast client-side content analysis
25 lines (23 loc) • 770 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
var _diacritics = _interopRequireDefault(require("../../../config/diacritics.js"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/** @module stringProcessing/replaceDiacritics */
/**
* Replaces all diacritics from the text based on the diacritics removal map.
*
* @param {string} text The text to remove diacritics from.
*
* @returns {string} The text with all diacritics replaced.
*/
function _default(text) {
const map = (0, _diacritics.default)();
for (let i = 0; i < map.length; i++) {
text = text.replace(map[i].letters, map[i].base);
}
return text;
}
//# sourceMappingURL=replaceDiacritics.js.map