mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Add types for capitalize (#16156)
Add an optional extended description…
This commit is contained in:
committed by
Sheetal Nandi
parent
b86db17028
commit
2a78cc163a
@@ -0,0 +1,12 @@
|
||||
import * as capitalize from "capitalize";
|
||||
import { words } from "capitalize";
|
||||
|
||||
capitalize("united states");
|
||||
|
||||
capitalize.words("united states");
|
||||
|
||||
capitalize.words('hello-cañapolísas');
|
||||
|
||||
capitalize.words("it's a nice day");
|
||||
|
||||
words("united states");
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for capitalize 1.0
|
||||
// Project: https://github.com/grncdr/js-capitalize
|
||||
// Definitions by: Frederick Fogerty <https://github.com/frederickfogerty/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/**
|
||||
* Capitalize the first letter of a string
|
||||
* @param input the string to capitalize
|
||||
*/
|
||||
declare function capitalize(input: string): string;
|
||||
declare namespace capitalize {
|
||||
/**
|
||||
* Capitalize each word in a string
|
||||
* @param input the string to capitalize
|
||||
*/
|
||||
function words(input: string): string;
|
||||
}
|
||||
export = capitalize;
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"capitalize-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user