dreamerslab/node.inflection — pull request #10 by luk3thomas (2013-05-27 18:45:30+00:00)
Title: Transform

First off, thanks creating inflection. I've used it in a few projects, and I've always enjoyed it.

I found myself in a situation where I would like to run a string though multiple inflection methods without having to write so much code. The only way I have found is to do something like this:

```
// I want to transform the string "all job" into "all-jobs"
var inflection = require( 'inflection' );

var str = inflection.pluralize( 'all job' );
str = inflection.dasherize( str );
```

To avoid writing extra code, I created a new method called `transform`. The method `transform` accepts two arguments. The first argument is the string we want to manipulate. The second argument is an array of inflection methods we want to use on the first argument.

```
// I want to transform the string "all job" into "all-jobs"
var inflection = require( 'inflection' );

var str = inflection.transform( 'all job', [ 'pluralize', 'dasherize' ] );
```

I am not attached to the name of the method `transform` or any of the code I've written. I figured this was the least painful way to create the functionality I wanted. Let me know what you think.

Thanks