Skip to content

AllProfanity v2.0.0 – Full Rewrite, Leet Speak, Severity & More!

Choose a tag to compare

@ayush-jadaun ayush-jadaun released this 09 Jun 10:03
· 21 commits to main since this release

Changelog

[2.0.0] - 2025-06-09

🚀 Major Changes

  • Zero Dependencies: AllProfanity is now fully self-contained and no longer depends on leo-profanity or any other external library (except for word lists).
  • Performance: Built from scratch for maximum speed and extensibility.

🆕 Features

  • Leet Speak Detection: Detects leet/obfuscated profanities (e.g., f*ck, ph@k, etc).
  • Severity Levels: Profanity detection now returns a severity rating (MILD, MODERATE, SEVERE, EXTREME).
  • Advanced Detection: Use detect() to get detailed results, including detected words, positions, cleaned text, and severity.
  • Partial Word & Strict Mode: Fine-grained control over partial word detection and strict word boundary matching.
  • Whitelist Support: Add or remove words from a whitelist to prevent false positives.
  • Full Customization: New configuration options: case sensitivity, leet speak, strict mode, partial detection, custom placeholders, and more.
  • Custom Dictionaries: Load your own language packs or word lists easily.
  • Exportable Dictionaries: All language word lists are now exportable from the package.

🛠️ Improvements

  • API Consistency: More predictable and organized API; cleans and detects match the same rules.
  • TypeScript: Improved type definitions and interface documentation.
  • Examples: Better, more comprehensive demo and usage examples.
  • No More leo-profanity: Fully custom implementation for all detection and cleaning logic.

⚠️ Breaking Changes

  • API Changes: Some API methods and options have changed or been renamed for clarity.
  • Default Languages: Only English and Hindi are loaded by default; others must be loaded explicitly.
  • Placeholder Handling: setPlaceholder() now only sets a single character for character-level cleaning.

See the README for full migration instructions and new usage examples!