inf

inflecta

A better port of ActiveSupport Inflector to JS.

Showing:

Popularity

Downloads/wk

0

Maintenance

No Maintenance Data Available

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Build Status

Inflecta

What? Another ActiveSupport::Inflector port? Yeah, sorry.

The primary difference between inflecta and other ports is that inflecta translates the Ruby idioms to JavaScript idioms. It goes all the way.

The most important method is constantize which is not even attempted in most ports. In fact, the only reason we really need to pluralize or singularize things is so that we can automatically determine the class to instantiate from the name of the data key. That is the whole point of ActiveSupport::Inflector, humanize is just a nice side effect.

In Ruby the scope resolution operator is ::. JavaScript doesn't have any such thing, instead people generally namespace classes using a module pattern like MyApp.Models.MyModel. For that reason inflecta uses . rather than blindly copying the Ruby scope resolution operator.

In JavaScript variables and properties are usually named with camel case. In Ruby they are named with underscores. It generally doesn't make a big difference, but if we want to implement humanize then it better work with our default conventions.

Real sorry about the name, but inflector was taken on npm.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial