Merge pull request #17426 from plantain-00/uppercamelcase

add types for uppercamelcase
This commit is contained in:
Nathan Shively-Sanders
2017-06-23 09:27:27 -07:00
committed by GitHub
3 changed files with 57 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
// Type definitions for uppercamelcase
// Project: https://github.com/samverschueren/uppercamelcase
// Definitions by: York Yao <https://github.com/plantain-00>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function upperCamelCase(...args: string[]): string;
export = upperCamelCase;
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"uppercamelcase-tests.ts"
]
}
@@ -0,0 +1,28 @@
import upperCamelCase = require('uppercamelcase');
upperCamelCase('foo-bar');
//=> FooBar
upperCamelCase('foo_bar');
//=> FooBar
upperCamelCase('Foo-Bar');
//=> FooBar
upperCamelCase('--foo.bar');
//=> FooBar
upperCamelCase('__foo__bar__');
//=> FooBar
upperCamelCase('foo bar');
//=> FooBar
upperCamelCase("--foo-bar");
//=> FooBar
upperCamelCase('foo', 'bar');
//=> 'FooBar'
upperCamelCase('__foo__', '--bar');
//=> 'FooBar'