DefinitelyTyped/types/capitalize/index.d.ts
Piotr Błażejewicz (Peter Blazejewicz) 9621b6bbef
update(capitalize): version 2 bump (#45391)
* update(capitalize): version 2 bump

This updates definition to v2. As the changes are completely
non-breaking (optional params added) the version is just updated without
creating v1 at the same time.

- optional `preserve` parameter added
- version bump
- maintainer added
- minor changes to DT trivia (TS version no longer required, TSLint
exclusion added inline for clariy, instead of in-file).

https://github.com/grncdr/js-capitalize/compare/v1.0.0...v2.0.2#diff-168726dbe96b3ce427e7fedce31bb0bc

Thanks!

* Rewrite tests details as per PR comment

/cc @rederickfogerty
2020-06-16 02:47:28 -07:00

22 lines
841 B
TypeScript

// Type definitions for capitalize 2.0
// Project: https://github.com/grncdr/js-capitalize
// Definitions by: Frederick Fogerty <https://github.com/frederickfogerty>
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Capitalize the first letter of a string
* @param input the string to capitalize
* @param [preserve] preserve casing of the rest of the strings content
*/
declare function capitalize(input: string, preserve?: boolean): string;
declare namespace capitalize {
/**
* Capitalize each word in a string
* @param input the string to capitalize
* @param [preserve] preserve casing of the rest of the strings content
*/
function words(input: string, preserve?: boolean): string;
}
export = capitalize;