Giter Site home page Giter Site logo

cityssm / unleet Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 3.0 679 KB

Removes symbols and character combinations from a text string, and replaces them with the letters they commonly represent.

Home Page: https://www.npmjs.com/package/@cityssm/unleet

License: MIT License

JavaScript 50.06% TypeScript 49.94%
leet bad-words filter sanitize leet-converter unleet deleet decode hacktoberfest

unleet's Introduction

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!

unleet's People

Contributors

codacy-badger avatar dangowans avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

unleet's Issues

Heap out of memory error

Sometimes when using this package, a heap out of memory error occurs. This usually happens with longer strings.

Version: 1.0.3
Node Version: 16.6

Can't resolve 'fs' and 'fileURLToPath' was not found in 'url'

Since upgrading @cityssm/simple-password-generator from version 2.0.2 to 2.1.1 getting the follwing errors:
ERROR in ./node_modules/@cityssm/unleet/translations.js 1:0-25
Module not found: Error: Can't resolve 'fs' in '/node_modules/@cityssm/unleet'

ERROR in ./node_modules/@cityssm/unleet/translations.js 3:25-38
export 'fileURLToPath' (imported as 'fileURLToPath') was not found in 'url' (possible exports: Url, format, parse, resolve, resolveObject)

Looks to be changes from this commit.
e22e5a4

I'm using Laravel Mix with webpack for building js.

I've tried adding this which seems to fix the first issue but the second is still present:

mix.webpackConfig({
    resolve: {
        fallback: {
            "fs": false,
            "path": false,
            "os": false,
        }
    }
});

Error [ERR_REQUIRE_ESM]: require() of ES Module not supported

// test.ts
import unleet from '@cityssm/unleet'

unleet('b@d w0rd')

If I run either yarn ts-node test.ts or yarn tsc test.ts && node test.js I get the following error:

var unleet_1 = require("@cityssm/unleet");
               ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/eodeluga/src/test/node_modules/@cityssm/unleet/index.js from /home/eodeluga/test/test.js not supported.
Instead change the require of index.js in /home/eodeluga/src/test/test.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/eodeluga/src/test/test.js:3:16) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v18.18.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.