9.5.0 • Published 2 years ago

anti-swear v9.5.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago
  • 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
9.5.0

2 years ago

9.4.0

2 years ago

9.3.0

2 years ago

9.2.0

2 years ago

9.1.0

2 years ago

9.0.0

2 years ago

8.1.0

2 years ago

8.0.0

2 years ago

7.1.0

2 years ago

7.0.1

2 years ago

7.0.0

2 years ago

6.0.0

2 years ago

5.2.2

2 years ago

5.2.1

2 years ago

5.2.0

2 years ago

5.1.0

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.4.4

2 years ago

4.4.1

2 years ago

4.1.1

2 years ago

4.1.0

2 years ago

4.0.2

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago