Merge pull request #5215 from stpettersens/master

Type definitions and tests for sentence-case
This commit is contained in:
Horiuchi_H
2015-08-05 11:05:46 +09:00
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
/// <reference path="sentence-case.d.ts" />
import sentenceCase = require('sentence-case');
console.log(sentenceCase(null)); // => ""
console.log(sentenceCase('string')); // => "stringe"
console.log(sentenceCase('dot.case')); // => "dot case"
console.log(sentenceCase('camelCase')); // => "camel case"
console.log(sentenceCase('Beyoncé Knowles')); // => "beyoncé knowles"
console.log(sentenceCase('A STRING', 'tr')); // => "a strıng"
console.log(sentenceCase('HELLO WORLD!', null, '_')); // => "hello_world"

9
sentence-case/sentence-case.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
// Type definitions for sentence-case
// Project: https://github.com/blakeembrey/sentence-case
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "sentence-case" {
function sentenceCase(string: string, locale?: string, repl?: string): string;
export = sentenceCase;
}