Travis build: 533 [cron]

This commit is contained in:
30secondsofcode
2018-09-26 20:14:02 +00:00
parent 65401e010e
commit a4058f9a2e
3 changed files with 1603 additions and 1604 deletions

View File

@ -26,7 +26,7 @@
"type": "snippet",
"attributes": {
"fileName": "allEqual.md",
"text": "Check if all elements are equal\n\nUse `Array.every()` to check if all the elements of the array are the same as the first one.",
"text": "Check if all elements in an array are equal.\n\nUse `Array.every()` to check if all the elements of the array are the same as the first one.",
"codeBlocks": [
"const allEqual = arr => arr.every(val => val === arr[0]);",
"allEqual([1, 2, 3, 4, 5, 6]); // false\nallEqual([1, 1, 1, 1]); // true"
@ -39,7 +39,7 @@
},
"meta": {
"archived": false,
"hash": "aa5122e8272d9ef81a634e960da9b0ddbe6d670cb3e801d7ffd17ba36cd1630a"
"hash": "2801b6d7350ed3dd502d1efbaf32f0f3e8671002843ac3930e7e38a7e085213d"
}
},
{
@ -3522,9 +3522,9 @@
"type": "snippet",
"attributes": {
"fileName": "mask.md",
"text": "Replaces all but the last `num` of characters with the specified mask character.\n\nUse `String.slice()` to grab the portion of the characters that need to be masked and use `String.replace()` with a regexp to replace every character with the mask character.\nConcatenate the masked characters with the remaining unmasked portion of the string.\nOmit the second argument, `num`, to keep a default of `4` characters unmasked. If `num` is negative, the unmasked characters will be at the start of the string.\nOmit the third argument, `mask`, to use a default character of `'*'` for the mask.",
"text": "Replaces all but the last `num` of characters with the specified mask character.\n\nUse `String.slice()` to grab the portion of the characters that will remain unmasked and use `String.padStart()` to fill the beginning of the string with the mask character up to the original length.\nOmit the second argument, `num`, to keep a default of `4` characters unmasked. If `num` is negative, the unmasked characters will be at the start of the string.\nOmit the third argument, `mask`, to use a default character of `'*'` for the mask.",
"codeBlocks": [
"const mask = (cc, num = 4, mask = '*') =>\n ('' + cc).slice(0, -num).replace(/./g, mask) + ('' + cc).slice(-num);",
"const mask = (cc, num = 4, mask = '*') => `${cc}`.slice(-num).padStart(`${cc}`.length, mask);",
"mask(1234567890); // '******7890'\nmask(1234567890, 3); // '*******890'\nmask(1234567890, -4, '$'); // '$$$$567890'"
],
"tags": [
@ -3536,7 +3536,7 @@
},
"meta": {
"archived": false,
"hash": "c229055a0698ea0a36daa96a36172d1401e80ca98012752804d86f007cf721d3"
"hash": "b5217d2c91e86fb37ea02b5339140bba05f8d88d43a42dd3abcb9acf0c1d1ddf"
}
},
{

View File

@ -1,3 +1,2 @@
const mask = (cc, num = 4, mask = '*') =>
('' + cc).slice(-num).padStart(('' + cc).length, mask);
const mask = (cc, num = 4, mask = '*') => `${cc}`.slice(-num).padStart(`${cc}`.length, mask);
module.exports = mask;

File diff suppressed because it is too large Load Diff