mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Avoid engine slow path for primitives in _(…). [closes #123]
Former-commit-id: 32e33b0c0d192915e6d5a83001b85645829ca0ab
This commit is contained in:
@@ -240,8 +240,8 @@
|
||||
* @returns {Object} Returns a `lodash` instance.
|
||||
*/
|
||||
function lodash(value) {
|
||||
// exit early if already wrapped
|
||||
if (value && value.__wrapped__) {
|
||||
// exit early if already wrapped, even if wrapped by a different `lodash` constructor
|
||||
if (value && typeof value == 'object' && value.__wrapped__) {
|
||||
return value;
|
||||
}
|
||||
// allow invoking `lodash` without the `new` operator
|
||||
|
||||
Reference in New Issue
Block a user