mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* 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
27 lines
703 B
TypeScript
27 lines
703 B
TypeScript
import * as capitalize from 'capitalize';
|
|
// tslint:disable-next-line:no-duplicate-imports
|
|
import { words } from 'capitalize';
|
|
|
|
// $ExpectError
|
|
capitalize();
|
|
// $ExpectType string
|
|
capitalize('united states');
|
|
// $ExpectType string
|
|
capitalize('uniTed staTes', true);
|
|
// $ExpectType string
|
|
capitalize.words('united states');
|
|
// $ExpectType string
|
|
capitalize.words('uniTed staTes', true);
|
|
// $ExpectType string
|
|
capitalize.words('uniTed staTes', false);
|
|
// $ExpectType string
|
|
capitalize.words('hello-cañapolísas');
|
|
// $ExpectType string
|
|
capitalize.words("it's a nice day", false);
|
|
// $ExpectError
|
|
words();
|
|
// $ExpectType string
|
|
words('united states');
|
|
// $ExpectType string
|
|
words('united states', false);
|