Remove semicolons.

This commit is contained in:
John-David Dalton
2017-02-04 23:50:10 -08:00
parent f3a8e55e70
commit 6cb3460fce
452 changed files with 4261 additions and 4261 deletions

View File

@@ -1,8 +1,8 @@
/** Used as references for various `Number` constants. */
const MAX_SAFE_INTEGER = 9007199254740991;
const MAX_SAFE_INTEGER = 9007199254740991
/* Built-in method references for those with the same name as other `lodash` methods. */
const nativeFloor = Math.floor;
const nativeFloor = Math.floor
/**
* The base implementation of `repeat` which doesn't coerce arguments.
@@ -13,23 +13,23 @@ const nativeFloor = Math.floor;
* @returns {string} Returns the repeated string.
*/
function baseRepeat(string, n) {
let result = '';
let result = ''
if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
return result;
return result
}
// Leverage the exponentiation by squaring algorithm for a faster repeat.
// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
do {
if (n % 2) {
result += string;
result += string
}
n = nativeFloor(n / 2);
n = nativeFloor(n / 2)
if (n) {
string += string;
string += string
}
} while (n);
} while (n)
return result;
return result
}
export default baseRepeat;
export default baseRepeat