lookalike-util v1.3.1
Made with 💖 by StatusPlus
Table of Contents
Features
- Removing Invisible Characters: Easily remove invisible characters from strings!
- Clearing Lookalikes: Ridding strings of characters that look like normal english letters/chars!
- Constantly updating Database: Database of lookalikes can update with new ideas!
Installation
With npm
Simply run:
npm i lookalike-utilThat's it! You're good to go!
With jsDelivr
In the <head> of your HTML document, add the following:
<head>
<!-- Other HTML head items -->
<script src="https://cdn.jsdelivr.net/npm/lookalike-util/dist/web/lookalike.js" defer>
</head>You can now reference using lookalikeUtil!
Compiling from source
To compile from source, first clone the repository from GitHub:
git clone https://github.com/Status-Plus/lookalike-util.git
git fetchThen, install all dependencies:
npm iTo run the testing suite, run:
npm testTo build the UMD compatibile package, run:
npm run buildFor lints, run:
npx eslint . --fixExamples
Via npm:
import { clearSimilar } from '../src/index';
const string = "Êċℎọ!"
console.log(clearSimilar(string)) // returns "Echo!"Via HTML
<!-- snip -->
<script>
window.lookalikeUtil.clearSimilar('Êċℎọ!'); // returns "Echo!"
</script>API
clearInvisible(string)
Returns a string with all "invisible" characters removed. (Not spaces).
Example:
lookalikeutil.clearInvisible("i am a ninja!") // returns string w/o invisible characters!clearSimilar(string)
Returns a string with all non-english characters that are abused to look like an english letter to bypass a filter, etc.
Example:
lookalikeutil.clearSimilar("Êċℎọ!") // returns "Echo!"Usecase
This is used internally by our team in our Discord bot and similar applications with the purpose of removing sneaky characters that are often abused by bad actors to bypass a filter or make it hard to contact them. Someone could bypass a word filter by using these special characters. This soloves that issue!
Contributing
To contribute, please follow the above section regarding compiling from source.
From there, feel free to work using src/index.js
If you would like to contibute to the database, please use lib/lookalike.js.
Before sending a pull request, please ensure tests, lints, and builds pass. Otherwise, CI will not pass!
License
This project is open-source under the MIT license: