UNPKG

@foxxiebot/sanitize

Version:

Sanitize and clean character strings.

17 lines (15 loc) 575 B
import unidecode from 'unidecode'; import latinize from 'latinize'; import removeAccents from 'remove-accents'; import { clean } from 'confusables'; var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); function sanitize(str) { return clean( unidecode(latinize(removeAccents(str))).replace(/\[\?\]/g, "").replace(/[@4]/g, "a").replace(/3/g, "e").replace(/0/g, "o") ); } __name(sanitize, "sanitize"); export { sanitize }; //# sourceMappingURL=index.mjs.map //# sourceMappingURL=index.mjs.map