|
277 | 277 | }\
|
278 | 278 | }\
|
279 | 279 | if (typeof chaining != "undefined") {\
|
280 |
| - var _chaining = _(numbers).chain(),\ |
| 280 | + var _chaining = _.chain ? _(numbers).chain() : _(numbers),\ |
281 | 281 | lodashChaining = lodash(numbers);\
|
282 | 282 | }\
|
283 | 283 | if (typeof compact != "undefined") {\
|
|
477 | 477 | \
|
478 | 478 | var settingsObject = { "variable": "data" };\
|
479 | 479 | \
|
480 |
| - var lodashTpl = lodash.template(tpl),\ |
481 |
| - lodashTplVerbose = lodash.template(tplVerbose, null, settingsObject);\ |
482 |
| - \ |
483 | 480 | var _tpl = _.template(tpl),\
|
484 | 481 | _tplVerbose = _.template(tplVerbose, null, settingsObject);\
|
| 482 | + \ |
| 483 | + var lodashTpl = lodash.template(tpl),\ |
| 484 | + lodashTplVerbose = lodash.template(tplVerbose, null, settingsObject);\ |
485 | 485 | }\
|
486 | 486 | if (typeof where != "undefined") {\
|
487 |
| - var whereObject = { "num": 9 };\ |
| 487 | + var _findWhere = _.findWhere || _.find,\ |
| 488 | + lodashFindWhere = lodash.findWhere || lodash.find,\ |
| 489 | + whereObject = { "num": 9 };\ |
488 | 490 | }'
|
489 | 491 | });
|
490 | 492 |
|
|
926 | 928 | suites.push(
|
927 | 929 | Benchmark.Suite('`_.find` with `properties`')
|
928 | 930 | .add(buildName, {
|
929 |
| - 'fn': 'lodash.find(objects, whereObject)', |
| 931 | + 'fn': 'lodashFindWhere(objects, whereObject)', |
930 | 932 | 'teardown': 'function where(){}'
|
931 | 933 | })
|
932 | 934 | .add(otherName, {
|
933 |
| - 'fn': '_.findWhere(objects, whereObject)', |
| 935 | + 'fn': '_findWhere(objects, whereObject)', |
934 | 936 | 'teardown': 'function where(){}'
|
935 | 937 | })
|
936 | 938 | );
|
|
0 commit comments