glin-profanity 3.1.2 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,19 +1,16 @@
1
- import { L as Language, S as SeverityLevel, C as CheckProfanityResult } from './types-BgQe4FSE.cjs';
2
- export { c as ContextAwareConfig, F as Filter, a as FilterConfig, b as FilteredProfanityResult, H as HybridAnalysisResult, e as MLAnalysisResult, f as MLDetectorConfig, M as Match, F as ProfanityFilter, T as ToxicityLabel, d as ToxicityPrediction } from './types-BgQe4FSE.cjs';
1
+ import { F as FilterConfig, S as SeverityLevel, C as CheckProfanityResult } from './types-CdDqSZY7.cjs';
2
+ export { c as ContextAwareConfig, a as Filter, b as FilteredProfanityResult, H as HybridAnalysisResult, L as Language, e as MLAnalysisResult, f as MLDetectorConfig, M as Match, a as ProfanityFilter, T as ToxicityLabel, d as ToxicityPrediction } from './types-CdDqSZY7.cjs';
3
3
 
4
- interface ProfanityCheckerConfig {
5
- languages?: Language[];
6
- allLanguages?: boolean;
7
- caseSensitive?: boolean;
8
- wordBoundaries?: boolean;
9
- customWords?: string[];
10
- replaceWith?: string;
11
- severityLevels?: boolean;
12
- ignoreWords?: string[];
13
- allowObfuscatedMatch?: boolean;
14
- fuzzyToleranceLevel?: number;
4
+ /**
5
+ * Configuration options for the profanity checker hook and functions.
6
+ * Extends FilterConfig with additional convenience options for V3 features.
7
+ */
8
+ interface ProfanityCheckerConfig extends Omit<FilterConfig, 'logProfanity'> {
9
+ /** Minimum severity level to include in results */
15
10
  minSeverity?: SeverityLevel;
11
+ /** Auto-replace profanity with replaceWith string */
16
12
  autoReplace?: boolean;
13
+ /** Custom callback when profanity is detected */
17
14
  customActions?: (result: CheckProfanityResult) => void;
18
15
  }
19
16
  interface ProfanityCheckResult extends CheckProfanityResult {
@@ -282,4 +279,4 @@ declare function detectCharacterSets(text: string): {
282
279
  hasMixed: boolean;
283
280
  };
284
281
 
285
- export { CheckProfanityResult, Language, type LeetspeakLevel, type LeetspeakOptions, type ProfanityCheckResult, type ProfanityCheckerConfig, SeverityLevel, type UnicodeNormalizationOptions, checkProfanity, checkProfanityAsync, collapseRepeatedCharacters, collapseSpacedCharacters, containsLeetspeak, containsUnicodeObfuscation, convertFullWidth, convertHomoglyphs, detectCharacterSets, generateLeetspeakVariants, isWordProfane, normalizeLeetspeak, normalizeNFKD, normalizeUnicode, removeZeroWidthCharacters, useProfanityChecker };
282
+ export { CheckProfanityResult, FilterConfig, type LeetspeakLevel, type LeetspeakOptions, type ProfanityCheckResult, type ProfanityCheckerConfig, SeverityLevel, type UnicodeNormalizationOptions, checkProfanity, checkProfanityAsync, collapseRepeatedCharacters, collapseSpacedCharacters, containsLeetspeak, containsUnicodeObfuscation, convertFullWidth, convertHomoglyphs, detectCharacterSets, generateLeetspeakVariants, isWordProfane, normalizeLeetspeak, normalizeNFKD, normalizeUnicode, removeZeroWidthCharacters, useProfanityChecker };
package/dist/index.d.ts CHANGED
@@ -1,19 +1,16 @@
1
- import { L as Language, S as SeverityLevel, C as CheckProfanityResult } from './types-BgQe4FSE.js';
2
- export { c as ContextAwareConfig, F as Filter, a as FilterConfig, b as FilteredProfanityResult, H as HybridAnalysisResult, e as MLAnalysisResult, f as MLDetectorConfig, M as Match, F as ProfanityFilter, T as ToxicityLabel, d as ToxicityPrediction } from './types-BgQe4FSE.js';
1
+ import { F as FilterConfig, S as SeverityLevel, C as CheckProfanityResult } from './types-CdDqSZY7.js';
2
+ export { c as ContextAwareConfig, a as Filter, b as FilteredProfanityResult, H as HybridAnalysisResult, L as Language, e as MLAnalysisResult, f as MLDetectorConfig, M as Match, a as ProfanityFilter, T as ToxicityLabel, d as ToxicityPrediction } from './types-CdDqSZY7.js';
3
3
 
4
- interface ProfanityCheckerConfig {
5
- languages?: Language[];
6
- allLanguages?: boolean;
7
- caseSensitive?: boolean;
8
- wordBoundaries?: boolean;
9
- customWords?: string[];
10
- replaceWith?: string;
11
- severityLevels?: boolean;
12
- ignoreWords?: string[];
13
- allowObfuscatedMatch?: boolean;
14
- fuzzyToleranceLevel?: number;
4
+ /**
5
+ * Configuration options for the profanity checker hook and functions.
6
+ * Extends FilterConfig with additional convenience options for V3 features.
7
+ */
8
+ interface ProfanityCheckerConfig extends Omit<FilterConfig, 'logProfanity'> {
9
+ /** Minimum severity level to include in results */
15
10
  minSeverity?: SeverityLevel;
11
+ /** Auto-replace profanity with replaceWith string */
16
12
  autoReplace?: boolean;
13
+ /** Custom callback when profanity is detected */
17
14
  customActions?: (result: CheckProfanityResult) => void;
18
15
  }
19
16
  interface ProfanityCheckResult extends CheckProfanityResult {
@@ -282,4 +279,4 @@ declare function detectCharacterSets(text: string): {
282
279
  hasMixed: boolean;
283
280
  };
284
281
 
285
- export { CheckProfanityResult, Language, type LeetspeakLevel, type LeetspeakOptions, type ProfanityCheckResult, type ProfanityCheckerConfig, SeverityLevel, type UnicodeNormalizationOptions, checkProfanity, checkProfanityAsync, collapseRepeatedCharacters, collapseSpacedCharacters, containsLeetspeak, containsUnicodeObfuscation, convertFullWidth, convertHomoglyphs, detectCharacterSets, generateLeetspeakVariants, isWordProfane, normalizeLeetspeak, normalizeNFKD, normalizeUnicode, removeZeroWidthCharacters, useProfanityChecker };
282
+ export { CheckProfanityResult, FilterConfig, type LeetspeakLevel, type LeetspeakOptions, type ProfanityCheckResult, type ProfanityCheckerConfig, SeverityLevel, type UnicodeNormalizationOptions, checkProfanity, checkProfanityAsync, collapseRepeatedCharacters, collapseSpacedCharacters, containsLeetspeak, containsUnicodeObfuscation, convertFullWidth, convertHomoglyphs, detectCharacterSets, generateLeetspeakVariants, isWordProfane, normalizeLeetspeak, normalizeNFKD, normalizeUnicode, removeZeroWidthCharacters, useProfanityChecker };
@@ -1,5 +1,5 @@
1
- import { T as ToxicityLabel, f as MLDetectorConfig, e as MLAnalysisResult, a as FilterConfig, C as CheckProfanityResult, H as HybridAnalysisResult, F as Filter } from '../types-BgQe4FSE.cjs';
2
- export { d as ToxicityPrediction } from '../types-BgQe4FSE.cjs';
1
+ import { T as ToxicityLabel, f as MLDetectorConfig, e as MLAnalysisResult, F as FilterConfig, C as CheckProfanityResult, H as HybridAnalysisResult, a as Filter } from '../types-CdDqSZY7.cjs';
2
+ export { d as ToxicityPrediction } from '../types-CdDqSZY7.cjs';
3
3
 
4
4
  /**
5
5
  * ML-based toxicity detection using TensorFlow.js.
@@ -1,5 +1,5 @@
1
- import { T as ToxicityLabel, f as MLDetectorConfig, e as MLAnalysisResult, a as FilterConfig, C as CheckProfanityResult, H as HybridAnalysisResult, F as Filter } from '../types-BgQe4FSE.js';
2
- export { d as ToxicityPrediction } from '../types-BgQe4FSE.js';
1
+ import { T as ToxicityLabel, f as MLDetectorConfig, e as MLAnalysisResult, F as FilterConfig, C as CheckProfanityResult, H as HybridAnalysisResult, a as Filter } from '../types-CdDqSZY7.js';
2
+ export { d as ToxicityPrediction } from '../types-CdDqSZY7.js';
3
3
 
4
4
  /**
5
5
  * ML-based toxicity detection using TensorFlow.js.
@@ -347,4 +347,4 @@ interface HybridAnalysisResult {
347
347
  reason: string;
348
348
  }
349
349
 
350
- export { type CheckProfanityResult as C, Filter as F, type HybridAnalysisResult as H, type Language as L, type Match as M, SeverityLevel as S, type ToxicityLabel as T, type FilterConfig as a, type FilteredProfanityResult as b, type ContextAwareConfig as c, type ToxicityPrediction as d, type MLAnalysisResult as e, type MLDetectorConfig as f };
350
+ export { type CheckProfanityResult as C, type FilterConfig as F, type HybridAnalysisResult as H, type Language as L, type Match as M, SeverityLevel as S, type ToxicityLabel as T, Filter as a, type FilteredProfanityResult as b, type ContextAwareConfig as c, type ToxicityPrediction as d, type MLAnalysisResult as e, type MLDetectorConfig as f };
@@ -347,4 +347,4 @@ interface HybridAnalysisResult {
347
347
  reason: string;
348
348
  }
349
349
 
350
- export { type CheckProfanityResult as C, Filter as F, type HybridAnalysisResult as H, type Language as L, type Match as M, SeverityLevel as S, type ToxicityLabel as T, type FilterConfig as a, type FilteredProfanityResult as b, type ContextAwareConfig as c, type ToxicityPrediction as d, type MLAnalysisResult as e, type MLDetectorConfig as f };
350
+ export { type CheckProfanityResult as C, type FilterConfig as F, type HybridAnalysisResult as H, type Language as L, type Match as M, SeverityLevel as S, type ToxicityLabel as T, Filter as a, type FilteredProfanityResult as b, type ContextAwareConfig as c, type ToxicityPrediction as d, type MLAnalysisResult as e, type MLDetectorConfig as f };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glin-profanity",
3
- "version": "3.1.2",
3
+ "version": "3.1.5",
4
4
  "description": "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 is involved, Glin-Profanity helps you maintain a clean and respectful environment.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",