[refactor] Moved 'addOffset' to its own TS file

This commit is contained in:
Steven Evans
2018-07-05 13:52:37 -04:00
parent 875f7b4438
commit d20516b03c
5 changed files with 29 additions and 17 deletions
-12
View File
@@ -19,17 +19,6 @@ function clearObject(obj) {
}
}
//Adds a random offset to a number within a certain percentage
//e.g. addOffset(100, 5) will return anything from 95 to 105.
//The percentage argument must be between 0 and 100;
function addOffset(n, percentage) {
if (percentage < 0 || percentage > 100) {return n;}
var offset = n * (percentage / 100);
return n + ((Math.random() * (2 * offset)) - offset);
}
//Given an element by its Id(usually an 'a' element), removes all event listeners
//from that element by cloning and replacing. Then returns the new cloned element
function clearEventListeners(elemId) {
@@ -133,7 +122,6 @@ function powerOfTwo(n) {
export {sizeOfObject,
clearObject,
addOffset,
clearEventListeners,
compareArrays,
printArray,