@cityssm/unleet
TypeScript icon, indicating that this package has built-in type declarations

2.4.0 • Public • Published

unleet

npm Codacy Badge Maintainability Test Coverage AppVeyor Snyk Vulnerabilities for GitHub Repo

Worry less about maintaining a list of every possible spelling of every bad word.

Ensuring that text entered by a user is polite can be difficult. Generating memorable passwords automatically using letters and numbers, without creating an offensive combination is challenging as well.

This project attempts to help by taking a piece of text, and replacing symbols that are commonly used to hide bad words with the letters they may represent. The result can be scanned against a far simpler bad words file.

Installation

npm install @cityssm/unleet

Usage

import unleet from "@cityssm/unleet";

unleet("b@d w0rd");
// => [ "bad word" ]

unleet("1337 $P33K");
// => [ 'ieet zpeek', 'ieet speek', 'leet zpeek', 'leet speek' ]

unleet("0rg@ni℠");
// => [ 'organizm', 'organism' ]

Contributing

Found some text that doesn't unleet properly? Open an issue.

Pull requests with more bizarre Unicode-to-letter mappings are more than welcome!

Package Sidebar

Install

npm i @cityssm/unleet

Weekly Downloads

92

Version

2.4.0

License

MIT

Unpacked Size

33.5 kB

Total Files

13

Last publish

Collaborators

  • dgowans