obscenity / keepEndCensorStrategy
keepEndCensorStrategy(
baseStrategy):TextCensorStrategy
Defined in: src/censor/BuiltinStrategies.ts:51
A text censoring strategy that extends another strategy, adding the last character matched at the end of the generated string.
Strategy to extend. It will be used to produce the start of the generated string.
A [[TextCensorStrategy]] for use with the [[TextCensor]].
const strategy = keepEndCensorStrategy(asteriskCensorStrategy());
const censor = new TextCensor().setStrategy(strategy);
// Before: 'fuck you'
// After: '***k you'