🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

anti-swear

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

anti-swear

Split Bad Words Content With Easy Methods!

unpublished
latest
npmnpm
Version
9.5.0
Version published
Maintainers
1
Created
Source
  • Split Bad Words Content With Easy Methods!..

Supported languages:

Arabic, English

NPM Installation:

npm install anti-swear

CDN Installation:

<script src="https://cdn.jsdelivr.net/npm/anti-swear@latest/script.js"></script>

Split Method:

const AntiSwear = require("anti-swear");
const antiSwear = new AntiSwear();

/* Split The Bad Words */
console.log(antiSwear.split("hi poops")); // ====> "hi ****s"
console.log(antiSwear.split("hello idiot")); // ====> "hello *****"

/* The Package Can Detect The Bad Words Between Symbols */
console.log(antiSwear.split("hi PO-oPs")); // ====> "hi ****s"
console.log(antiSwear.split("hello id!iot")); // ====> "hello *****"
console.log(antiSwear.split("hi p@$*)#&@(o$@&(*)/\"o@&($)'p-*)$)*@s")); // ====> "hi ****s"
//                              ^        ^        ^      ^
console.log(antiSwear.split("hello i;d!$!**(=3>i'8*#)@_o!^*@&t")); // ====> "hello *****"
//                                 ^ ^         ^       ^     ^

Detect Method:

const AntiSwear = require("anti-swear");
const antiSwear = new AntiSwear();

/* Detect The Bad Words And Return Array */
console.log(antiSwear.detect("hi i'm jehaad, and i'm so dumb")); // ====> [ 'dumb' ]
console.log(antiSwear.detect("hello sorry, i'm not an idiot and s?tu/$pi@d")); // ====> [ 'i+dio+t', 's?tu/$pi@d' ]

Replace Method:

const AntiSwear = require("anti-swear");
const antiSwear = new AntiSwear();

/* Set The Replace Symbol "#" */
antiSwear.replace("#")

/* Replace The Bad Words To The Replace Symbol */
console.log(antiSwear.split("hi poops")); // ====> "hi ####s"
console.log(antiSwear.split("hello idiot")); // ====> "hello #####"

/* Set The Replace Letters "ABC" */
antiSwear.replace("ABC")

/* Replace The Bad Words To The Replace Symbol */
console.log(antiSwear.split("hi poops")); // ====> "hi ABCABCABCABCs"
console.log(antiSwear.split("hello idiot")); // ====> "hello ABCABCABCABCABC"

isContent Method:

const AntiSwear = require("anti-swear");
const antiSwear = new AntiSwear();

/* Return False Because its Not Content Bad Words */
console.log(antiSwear.isContent("hello friend")); // ====> false

/* Return True Because its Content Bad Words */
console.log(antiSwear.isContent("hi poops")); // ====> true

isNotContent Method:

const AntiSwear = require("anti-swear");
const antiSwear = new AntiSwear();

/* Return True Because its Not Content Bad Words */
console.log(antiSwear.isNotContent("hello friend")); // ====> true

/* Return False Because its Content Bad Words */
console.log(antiSwear.isNotContent("hi poops")); // ====> false

BadWords Method:

const AntiSwear = require("anti-swear");
const antiSwear = new AntiSwear();

// Warning: This Method Adding Words/Emojis To The Default Bad words Array..
// It Not Makes a New Array!

/* Return False Because its Not Content Bad Words */
console.log(antiSwear.isContent("hi that's test1")); // ====> false

/* Adding "test1" & "test2" as a Bad Words */
antiSwear.badWords("test1", "test2")

/* Return True Because its Content Bad Words */
console.log(antiSwear.isContent("hi that's test1")); // ====> true
console.log(antiSwear.isContent("what's test2?")); // ====> true

Ignore Method:

const AntiSwear = require("anti-swear");
const antiSwear = new AntiSwear();

/* Return True Because its Content Bad Words */
console.log(antiSwear.isContent("hi i like poops")); // ====> true

/* Adding "poop" & "idiot" as Not a Bad Words */
antiSwear.ignore("poop", "idiot")

/* Return False Because its Not Content Bad Words */
console.log(antiSwear.isContent("poop")); // ====> false
console.log(antiSwear.isContent("idiot")); // ====> false
  • My Website: Click Here!
  • My Discord Server: Join Here!

Keywords

anti-swear

FAQs

Package last updated on 09 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts