123456789101112131415161718192021 |
- function desensitization(string="", start, end) {
- var star = ''
- function makeStar(number) {
- if (number > 0) {
- star += '*';
- return makeStar(--number)
- } else {
- return star
- }
- };
- return string.substring(0, start) + makeStar(end - start) + string.substring(end)
- }
- function indexOf(array, value) {
- return array.indexOf(value)
- }
- module.exports = {
- desensitization: desensitization,
- indexOf:indexOf,
- }
|