demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/lodash-4.17.20/_baseRepeat.js

Path
demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/_dependencies/npm/lodash-4.17.20/_baseRepeat.js
Status
scanned
Type
file
Name
_baseRepeat.js
Extension
.js
Programming language
JavaScript
Mime type
text/plain
File type
ASCII text
Tag

      
    
Rootfs path

      
    
Size
952 (952 bytes)
MD5
5fd77e960cb0da80a6eed6ffd1468185
SHA1
e5acd9c33e9026b8848de16db87d9ee1dfe293db
SHA256
81f68d89a4e906997ed62b210341999c6e2f61c4aaf6e1404e661a87ba79d61a
SHA512

      
    
SHA1_git
ee44c31ab0c4b171b6ba8be43989c8e205ef4ff6
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
_baseRepeat.js | 952 bytes |

/** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeFloor = Math.floor; /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { 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; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } module.exports = baseRepeat;
URL Start line End line
https://en.wikipedia.org/wiki/Exponentiation_by_squaring 21 21
Package URL License Primary language
pkg:npm/acme-demo-app@1.0.0 JavaScript
pkg:npm/lodash@4.17.20 mit JavaScript