@aero/sanitizer

Tiny text sanitizer based on confusables.

Usage no npm install needed!

<script type="module">
  import aeroSanitizer from 'https://cdn.skypack.dev/@aero/sanitizer';
</script>

README

@aero/sanitizer

Credit where it's due

This project is derived from FGRibreau/node-unidecode. The original is created and licensed by Francois-Guillaume Ribreau under the BSD 3-Clause "New" or "Revised" License.

Unidecode is JavaScript port of the perl module Text::Unicode. See Text::Unicode for the original README file, including methodology and limitations. Note that all the files named 'x??.js' in data are derived directly from the equivalent perl file, and both sets of files are distributed under the perl license not the BSD license.

Installation

npm i @aero/sanitizer

Usage

sanitizer.clean("aéà)àçé");
> 'aea)ace'
sanitizer.clean("に間違いがないか、再度確認してください。再読み込みしてください。");
> 'niJian Wei iganaika, Zai Du Que Ren sitekudasai. Zai Du miIp misitekudasai.'