glin-profanity
Version:
Glin-Profanity is a lightweight and efficient npm package designed to detect and filter profane language in text inputs across multiple languages. Whether you’re building a chat application, a comment section, or any platform where user-generated content
21 lines (18 loc) • 822 B
text/typescript
import { F as FilterConfig, S as SeverityLevel, C as CheckProfanityResult } from './types-B9c_ik4k.cjs';
/**
* Configuration options for the profanity checker hook and functions.
* Extends FilterConfig with additional convenience options for V3 features.
*/
interface ProfanityCheckerConfig extends Omit<FilterConfig, 'logProfanity'> {
/** Minimum severity level to include in results */
minSeverity?: SeverityLevel;
/** Auto-replace profanity with replaceWith string */
autoReplace?: boolean;
/** Custom callback when profanity is detected */
customActions?: (result: CheckProfanityResult) => void;
}
interface ProfanityCheckResult extends CheckProfanityResult {
filteredWords: string[];
autoReplaced: string;
}
export type { ProfanityCheckerConfig as P, ProfanityCheckResult as a };