Closed waihon closed 3 years ago
That's a great point, thank you! I'll simplify this for the next release.
The helper is now just:
import { helper } from '@ember/component/helper';
import { capitalize as emberCapitalize } from '@ember/string';
export function capitalize(input) {
return input[0].split(/\s+/).map(emberCapitalize).join(' ');
}
export default helper(capitalize);
On page 272, it's mentioned:
The Ember.js documentation at https://api.emberjs.com/ember/3.28/classes/String/methods/capitalize?anchor=capitalize give an example that illustrate only the first character of a string will be converted to uppercase while the remaining will be status quo:
If that's the case, do we still need to explicitly call the capitalize function only on the first character?