Merge pull request #751 from Theomg/master

[ENHANCEMENT] Simpler solution to mask using padStart
This commit is contained in:
Angelos Chalaris
2018-09-26 12:27:33 +03:00
committed by GitHub
2 changed files with 3 additions and 5 deletions

View File

@ -1,3 +1,3 @@
const mask = (cc, num = 4, mask = '*') =>
('' + cc).slice(0, -num).replace(/./g, mask) + ('' + cc).slice(-num);
('' + cc).slice(-num).padStart(('' + cc).length, mask);
module.exports = mask;