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
function getDirection( angle ){ | |
// We divide it into 16 sections | |
let directions = ["N","NNE","NE","ENE","E", | |
"ESE", "SE", "SSE","S", | |
"SSW","SW","WSW","W", | |
"WNW","NW","NNW" ]; | |
// This means, every 360 / 16 degree, there's a section change | |
// So, in our case, every 22.5 degree, there's a section change | |
// In order to get the correct section, we just need to divide | |
let section = parseInt( angle/22.5 + 0.5 ); |
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
/** | |
* Detect words in a paragraph. | |
* @type {RegExp} ['word', 'word', ...] | |
*/ | |
export const WORDS = /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g | |
/** | |
* Detect a valid Venezuelan phone number (area code included) | |
* @type {RegExp} | |
*/ |