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
| 'use strict' | |
| /** | |
| * Calculate relative value from number and percentage. | |
| * | |
| * @example f(500, 10) -> 50 | |
| * @example f(500, 200) -> 1000 | |
| */ | |
| function numberFromPercentage(value, percentage) { | |
| return (value / 100) * percentage |
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
| /** | |
| * Convert URL from Youtube video for URL for embeding. | |
| * | |
| * @param {string} videoUrl - URL of Youtube VIdeo | |
| */ | |
| function makeYoutubeEmbed(videoUrl) { | |
| if (typeof videoUrl !== 'string') { | |
| return undefined | |
| } |