Skip to content

Commit e34f20e

Browse files
committed
Type definitions for to-title-case (https://http://individed.com/code/to-title-case)
1 parent 563cc35 commit e34f20e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

to-title-case/to-title-case-tests.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/// <reference path="../node/node.d.ts" />
2+
/// <reference path="to-title-case.d.ts" />
3+
4+
import fs = require('fs');
5+
6+
fs.readFile('to-title-case.min.js', 'utf-8', function(err: any, code: string) {
7+
eval(code);
8+
var lowerCase: string = 'this title is in lowercase and will be title case';
9+
console.log(lowerCase.toTitleCase()); // Now in title case.
10+
});

to-title-case/to-title-case.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Type definitions for to-title-case
2+
// Project: https://github.com/gouch/to-title-case
3+
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
interface String {
7+
toTitleCase(): string;
8+
}

0 commit comments

Comments
 (0)