danhper / lodash-inflection

ActiveSupport::Inflector, for lodash!
MIT License
30 stars 6 forks source link

Support importing individual methods? #11

Open owenoak opened 5 years ago

owenoak commented 5 years ago

One of the things I like about lodash is the ability to pull in individual methods rather than the whole lodash toolchain via: `import isEqual from "lodash/isEqual"

For your project, the instructions state that you should _.mixin(...) to add inflector methods to lodash, but I never use lodash that way.

I quickly found that I could do: import inflection from "lodash-inflection" export const singularize = inflection.singularize.bind(inflection) and it seems to be working fine.

So, my request is to add support to importing individual methods in a style similar to lodash, so:

import singularize from "lodash-inflection/singularize" etc.

danhper commented 5 years ago

Hi, I am not against this but I do not have time to do this now. If you want to create a PR for this I will be more than happy to merge. Thank you!