@himorishige/noren-core
Version:
Core PII detection, masking, and tokenization library built on Web Standards
34 lines • 1.21 kB
TypeScript
/**
* PII validation functions for false positive reduction
* Implements lightweight, fast validation logic for each PII type
*/
import { type StrictnessLevel } from './constants.js';
import type { PiiType } from './types.js';
export interface ValidationResult {
valid: boolean;
confidence: number;
reason: string;
metadata?: Record<string, unknown>;
}
export interface ValidationContext {
surroundingText: string;
strictness: StrictnessLevel;
originalIndex: number;
}
/**
* Validate credit card candidate
*/
export declare function validateCreditCard(candidate: string, context: ValidationContext): ValidationResult;
/**
* Validate email address candidate
*/
export declare function validateEmail(candidate: string, context: ValidationContext): ValidationResult;
/**
* Main validation dispatcher with error handling
*/
export declare function validateCandidate(candidate: string, piiType: PiiType, context: ValidationContext): ValidationResult;
/**
* Debug helper to analyze validation results in a readable format
*/
export declare function debugValidation(candidate: string, piiType: PiiType, context: ValidationContext): void;
//# sourceMappingURL=validators.d.ts.map