@zakyyudha/habibi
Version:
A package to encrypt and decrypt PII fields with love and care
25 lines (24 loc) • 757 B
TypeScript
type EncryptDecryptFunction = (str: string) => string;
type Logger = (err: Error | any, key: string) => void;
interface Config {
piiFields?: string[];
encryptFn?: EncryptDecryptFunction;
decryptFn?: EncryptDecryptFunction;
hashFn?: EncryptDecryptFunction;
logger?: Logger;
stopOnError?: boolean;
}
declare class Habibi {
private readonly piiFields;
private readonly encryptFn;
private readonly decryptFn;
private readonly hashFn;
private readonly logger;
private readonly stopOnError;
constructor(config?: Config);
private processField;
private processFields;
decryptPIIFields(obj: any): any;
encryptPIIFields(obj: any): any;
}
export { Habibi, type EncryptDecryptFunction, type Config };