字符串脱敏
npm i desensitizer
or
yarn add desensitizer
const desensitizer = require('desensitizer')
desensitizer.desensitize('this is secret string') // th****ng
desensitizer.desensitizeObject({ password: 'password' }) // => { password: 'pa****rd' }
desensitizer.desensitizeObject({ password: 'password', key: 'serect' }, { keyPattern: /password|key/ }) // { password: 'pa****rd', key: 'se****ct' }