mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Make stub functions hoistable.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -15306,7 +15306,9 @@
|
|||||||
* _.times(2, _.stubFalse);
|
* _.times(2, _.stubFalse);
|
||||||
* // => [false, false]
|
* // => [false, false]
|
||||||
*/
|
*/
|
||||||
var stubFalse = constant(false);
|
function stubFalse() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A method that returns a new empty object.
|
* A method that returns a new empty object.
|
||||||
@@ -15343,7 +15345,9 @@
|
|||||||
* _.times(2, _.stubString);
|
* _.times(2, _.stubString);
|
||||||
* // => ['', '']
|
* // => ['', '']
|
||||||
*/
|
*/
|
||||||
var stubString = constant('');
|
function stubString() {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A method that returns `true`.
|
* A method that returns `true`.
|
||||||
@@ -15358,7 +15362,9 @@
|
|||||||
* _.times(2, _.stubTrue);
|
* _.times(2, _.stubTrue);
|
||||||
* // => [true, true]
|
* // => [true, true]
|
||||||
*/
|
*/
|
||||||
var stubTrue = constant(true);
|
function stubTrue() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invokes the iteratee `n` times, returning an array of the results of
|
* Invokes the iteratee `n` times, returning an array of the results of
|
||||||
|
|||||||
Reference in New Issue
Block a user