This file contains 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
/** | |
* Normalizes the string to lowercase letters and no accents | |
* @param {string} str string to normalize | |
* @return {string} return string normalized | |
*/ | |
const removeAccent = (str) => { | |
const replaceMap = { | |
'[ãâàáä]': 'a', | |
'[êèéë]': 'e', | |
'[îìíï]': 'i', |
This file contains 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
import waitForTrue from './waitForTrue' | |
export default waitForTrue |
This file contains 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
import throttle from 'throttle'; | |
const totalMoves = []; | |
let totalShakes = 0; | |
const mousePos = event => { | |
totalMoves.push({ | |
x: event.clientX, | |
y: event.clientY |
This file contains 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 saveMousePosition = totalClicks => event => { | |
if (!event) return totalClicks; | |
totalClicks.push(`${event.clientX}-${event.clientY}`); | |
return []; | |
}; | |
const addNewClick = saveMousePosition([]); | |
const _setRage = () => { | |
document.addEventListener('click', event => { | |
addNewClick(event); |
This file contains 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
/** | |
* _Get function is a copy of a method of loadash lib | |
* that get `property` of `object` testing all nested properties if needs it | |
* | |
* @param {object} obj | |
* @param {string} key | |
* | |
*/ | |
function _get(object, keys, defaultVal) { | |
keys = Array.isArray(keys) ? keys : keys.split('.') |