Redact

Redact

  • Docs
  • Help
  • Blog

›Guides

Getting Started

  • Installing Redact
  • Updating Redact

Guides

  • Blacklist
  • Whitelist
  • Redact
  • Blacklist Check
  • Blacklist Count

Utils

  • Available lists

Adding your blacklist

A blacklist is a list of strings or words that are considered banned or should be excluded from a given string/sentence.

Syntax

blacklist(...args: string[]): string[]

Parameters

...args: string[] - Given strings/words to be blacklisted.

Returns

string[] - The resulting blacklist that has been filtered to only have unique items.

Error

Throws an error if a string is not given.

Import

import { blacklist } from '@princedev/redact';

Examples

Basic usage with two given words.

const racialBlacklist = blacklist('nigga', 'eskimo');

racialBlacklist would be ['negro', 'eskimo'].

Adding multiple given words with duplicates.

const racialArray = ['negro', 'nigga', 'black'];

const racialBlacklist = blacklist('nigga', 'eskimo', ...racialArray);

racialBlacklist would be ['negro', 'nigga', 'black', 'eskimo'], removing the duplicate item 'nigga' in the list.

Last updated on 7/22/2020 by Prince Neil Cedrick Castro
← Updating RedactWhitelist →
  • Syntax
    • Parameters
    • Returns
    • Error
  • Import
  • Examples
Redact
Docs
Getting StartedGuides
Package
NPMGitHubStar
More
HelpBlog
aws.cedi@gmail.com
Copyright © 2020 Redact