util.sjs 504 B

12345678910111213141516171819202122
  1. var antmove_export = {};
  2. function desensitization(string = "", start, end) {
  3. var star = '';
  4. function makeStar(number) {
  5. if (number > 0) {
  6. star += '*';
  7. return makeStar(--number);
  8. } else {
  9. return star;
  10. }
  11. }
  12. ;
  13. return string.substring(0, start) + makeStar(end - start) + string.substring(end);
  14. }
  15. function indexOf(array, value) {
  16. return array.indexOf(value);
  17. }
  18. antmove_export = {
  19. desensitization: desensitization,
  20. indexOf: indexOf
  21. };
  22. export default antmove_export;