emberjs/ember-inflector

Update pluralize type definition to account for count and options arguments

timjcook opened this issue · 3 comments

Issue:
Currently the pluralize type definition only handles the case where a single argument is passed to the helper. As of this addition we can now pass in a count to inform the method what it should base it's choice to pluralize on, and an options hash that controls if the passed in count is interpolated into the string.

Fix:
We require an update to the type definition to account for the new functionality. Perhaps by overloading the definition. This example works for me.

export function pluralize(someString: string): string; // <-- existing
export function pluralize(count: number, someString: string, options?: { // <-- new
  withoutCount: boolean
}): string;

Happy to PR that if it seems reasonable.

Related: #298

fixed in #298