This example is with a globalReplaceWith, but I get similar results with basic redactor.
I show in the comments how some of the false values do not turn off redacting:
async function globalReplaceRedact(inputText, globalReplacementValue) {
const globalRedactor = new AsyncRedactor({ globalReplaceWith: globalReplacementValue,
builtInRedactors: {
names: {enabled: true},
emailAddress: {enabled: true},
creditCardNumber: {enabled: false}, // false does not work
phoneNumber: {enabled: false}, // false still redacts the last part of the phone number
streetAddress: {enabled: false},
usSocialSecurityNumber: {enabled: false}, // false only works on the first 5 digits and two hyphens
zipcode: {enabled: false}, // false does not work
}
});
redactedText = await globalRedactor.redactAsync(inputText)
console.log("");
console.log("Global Replacement Redaction");
console.log(redactedText);
};
This example is with a globalReplaceWith, but I get similar results with basic redactor. I show in the comments how some of the false values do not turn off redacting:
async function globalReplaceRedact(inputText, globalReplacementValue) { const globalRedactor = new AsyncRedactor({ globalReplaceWith: globalReplacementValue, builtInRedactors: { names: {enabled: true}, emailAddress: {enabled: true}, creditCardNumber: {enabled: false}, // false does not work phoneNumber: {enabled: false}, // false still redacts the last part of the phone number streetAddress: {enabled: false}, usSocialSecurityNumber: {enabled: false}, // false only works on the first 5 digits and two hyphens zipcode: {enabled: false}, // false does not work } }); redactedText = await globalRedactor.redactAsync(inputText) console.log(""); console.log("Global Replacement Redaction"); console.log(redactedText); };