pksunkara / inflect

custom inflections for nodejs
MIT License
229 stars 18 forks source link

native bindings #1

Closed omares closed 7 years ago

omares commented 11 years ago

The current native bindings implementation does not allow to pass parameters to the inflect methods because of the inner workings of prototype.__defineGetter__. Thus calling "example_string".camelize(false) results in an error.

I could provide a fix (pull request) for this that changes the getter calls to real method calls but unfortunately that would break backwards compatibility.

So instead of calling "example_string".camelize one would have to use real method calls "example_string".camelize() even if no parameters are given.

Is this okay for you?

pksunkara commented 11 years ago

No, that would be bad in my opinion. We should think of something else. There's only 2 cases where these parameters are required.

omares commented 11 years ago

Okay, to bad. How do you plan to solve the issue?

pksunkara commented 7 years ago

I would recommend using inflect.camelize('message_properties', false) form if anyone ever needs to pass that parameter.