This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const promiseAll = (promises) => { | |
return new Promise((resolve, reject) => { | |
let results = []; | |
let completed = 0; | |
promises.forEach((promise, index) => { | |
promise | |
.then((value) => { | |
completed += 1; | |
results[index] = { status: "fulfilled", value }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const validatePhoneNumber = (phone: string): boolean => { | |
const regExp = /\+38\s\(0(39|50|63|66|67|68|70|73|90|91|92|93|94|95|96|97|98|99)\)\s[\d]{3}-[\d]{2}-[\d]{2}/g; | |
return regExp.test(phone); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const checkByLuhn = (card: string): boolean => { | |
if (!card) { | |
return false; | |
} | |
let checksum: number = 0; | |
const digits: number[] = card.split("").map(Number); | |
for (let i = 0; i < digits.length; i += 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin for-size($range) { | |
$mobile: 480px; | |
$tablet: 768px; | |
$desktop: 1280px; | |
@if $range == mobile-only { | |
@media screen and (max-width: #{$mobile - 1}) { @content; } | |
} @else if $range == mobile { | |
@media screen and (min-width: $mobile) { @content; } | |
} @else if $range == tablet { |