lodash / lodash-webpack-plugin

Smaller modular Lodash builds.
Other
1.19k stars 63 forks source link

use _.orderBy is worng #150

Closed xiemms closed 6 years ago

xiemms commented 6 years ago

https://github.com/lodash/lodash-webpack-plugin/blob/25c423cf3eed73dea06099e93401d9d01f8fc1cd/src/mapping.js#L123

xiemms commented 6 years ago

image image

xiemms commented 6 years ago

image image

xiemms commented 6 years ago
import _ from 'lodash'

 var users = [
  { 'user': 'fred',   'age': 48 },
  { 'user': 'barney', 'age': 34 },
  { 'user': 'fred',   'age': 40 },
  { 'user': 'barney', 'age': 36 }
];

_.orderBy(users, ['user', 'age'], ['asc', 'desc'])

Error in render: "TypeError: iteratee is not a function" image

xiemms commented 6 years ago

i change 'shorthands': [['_baseIteratee', 'identity']] to 'shorthands': [['_baseIteratee', '_baseIteratee']]
it's ok

jdalton commented 6 years ago

Hi @xiemms!

If you'd like to enable shorthands you can do so with the plugin options.

xiemms commented 6 years ago

ok. thx