lodash.repeat
Advanced tools
Comparing version 3.2.0 to 4.0.0
97
index.js
/** | ||
* lodash 3.2.0 (Custom Build) <https://lodash.com/> | ||
* lodash 4.0.0 (Custom Build) <https://lodash.com/> | ||
* Build: `lodash modularize exports="npm" -o ./` | ||
@@ -9,3 +9,3 @@ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> | ||
*/ | ||
var root = require('lodash._root'); | ||
var toString = require('lodash.tostring'); | ||
@@ -20,4 +20,3 @@ /** Used as references for various `Number` constants. */ | ||
var funcTag = '[object Function]', | ||
genTag = '[object GeneratorFunction]', | ||
symbolTag = '[object Symbol]'; | ||
genTag = '[object GeneratorFunction]'; | ||
@@ -48,12 +47,5 @@ /** Used to match leading and trailing whitespace. */ | ||
/** Built-in value references. */ | ||
var Symbol = root.Symbol; | ||
/* Built-in method references for those with the same name as other `lodash` methods. */ | ||
var nativeFloor = Math.floor; | ||
/** Used to convert symbols to primitives and strings. */ | ||
var symbolProto = Symbol ? Symbol.prototype : undefined, | ||
symbolToString = Symbol ? symbolProto.toString : undefined; | ||
/** | ||
@@ -112,50 +104,2 @@ * Checks if `value` is classified as a `Function` object. | ||
/** | ||
* Checks if `value` is object-like. A value is object-like if it's not `null` | ||
* and has a `typeof` result of "object". | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is object-like, else `false`. | ||
* @example | ||
* | ||
* _.isObjectLike({}); | ||
* // => true | ||
* | ||
* _.isObjectLike([1, 2, 3]); | ||
* // => true | ||
* | ||
* _.isObjectLike(_.noop); | ||
* // => false | ||
* | ||
* _.isObjectLike(null); | ||
* // => false | ||
*/ | ||
function isObjectLike(value) { | ||
return !!value && typeof value == 'object'; | ||
} | ||
/** | ||
* Checks if `value` is classified as a `Symbol` primitive or object. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to check. | ||
* @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. | ||
* @example | ||
* | ||
* _.isSymbol(Symbol.iterator); | ||
* // => true | ||
* | ||
* _.isSymbol('abc'); | ||
* // => false | ||
*/ | ||
function isSymbol(value) { | ||
return typeof value == 'symbol' || | ||
(isObjectLike(value) && objectToString.call(value) == symbolTag); | ||
} | ||
/** | ||
* Converts `value` to an integer. | ||
@@ -235,37 +179,2 @@ * | ||
/** | ||
* Converts `value` to a string if it's not one. An empty string is returned | ||
* for `null` and `undefined` values. The sign of `-0` is preserved. | ||
* | ||
* @static | ||
* @memberOf _ | ||
* @category Lang | ||
* @param {*} value The value to process. | ||
* @returns {string} Returns the string. | ||
* @example | ||
* | ||
* _.toString(null); | ||
* // => '' | ||
* | ||
* _.toString(-0); | ||
* // => '-0' | ||
* | ||
* _.toString([1, 2, 3]); | ||
* // => '1,2,3' | ||
*/ | ||
function toString(value) { | ||
// Exit early for strings to avoid a performance hit in some environments. | ||
if (typeof value == 'string') { | ||
return value; | ||
} | ||
if (value == null) { | ||
return ''; | ||
} | ||
if (isSymbol(value)) { | ||
return Symbol ? symbolToString.call(value) : ''; | ||
} | ||
var result = (value + ''); | ||
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; | ||
} | ||
/** | ||
* Repeats the given string `n` times. | ||
@@ -272,0 +181,0 @@ * |
{ | ||
"name": "lodash.repeat", | ||
"version": "3.2.0", | ||
"version": "4.0.0", | ||
"description": "The lodash method `_.repeat` exported as a module.", | ||
@@ -18,4 +18,4 @@ "homepage": "https://lodash.com/", | ||
"dependencies": { | ||
"lodash._root": "^3.0.0" | ||
"lodash.tostring": "^4.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# lodash.repeat v3.2.0 | ||
# lodash.repeat v4.0.0 | ||
@@ -18,2 +18,2 @@ The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module. | ||
See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.2.0-npm-packages/lodash.repeat) for more details. | ||
See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.repeat) for more details. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7944
197
+ Addedlodash.tostring@^4.0.0
+ Addedlodash.tostring@4.1.4(transitive)
- Removedlodash._root@^3.0.0
- Removedlodash._root@3.0.1(transitive)