From e34f20e4f137fccb25e705d6147e836f76248d34 Mon Sep 17 00:00:00 2001 From: Sam Saint-Pettersen Date: Fri, 17 Jul 2015 12:04:53 +0100 Subject: [PATCH 1/3] Type definitions for to-title-case (https://http://individed.com/code/to-title-case) --- to-title-case/to-title-case-tests.ts | 10 ++++++++++ to-title-case/to-title-case.d.ts | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 to-title-case/to-title-case-tests.ts create mode 100644 to-title-case/to-title-case.d.ts diff --git a/to-title-case/to-title-case-tests.ts b/to-title-case/to-title-case-tests.ts new file mode 100644 index 0000000000..2dc1fd9f57 --- /dev/null +++ b/to-title-case/to-title-case-tests.ts @@ -0,0 +1,10 @@ +/// +/// + +import fs = require('fs'); + +fs.readFile('to-title-case.min.js', 'utf-8', function(err: any, code: string) { + eval(code); + var lowerCase: string = 'this title is in lowercase and will be title case'; + console.log(lowerCase.toTitleCase()); // Now in title case. +}); diff --git a/to-title-case/to-title-case.d.ts b/to-title-case/to-title-case.d.ts new file mode 100644 index 0000000000..2faa2d8d08 --- /dev/null +++ b/to-title-case/to-title-case.d.ts @@ -0,0 +1,8 @@ +// Type definitions for to-title-case +// Project: https://github.com/gouch/to-title-case +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface String { + toTitleCase(): string; +} From 7536f06587e518ff6301b74bd0d097d6e9b10fef Mon Sep 17 00:00:00 2001 From: Sam Saint-Pettersen Date: Sun, 19 Jul 2015 14:42:18 +0100 Subject: [PATCH 2/3] Type definitions and testsfor to-title-case-gouch --- .../to-title-case-gouch-tests.ts | 2 +- .../to-title-case-gouch.d.ts | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename to-title-case/to-title-case-tests.ts => to-title-case-gouch/to-title-case-gouch-tests.ts (77%) rename to-title-case/to-title-case.d.ts => to-title-case-gouch/to-title-case-gouch.d.ts (100%) diff --git a/to-title-case/to-title-case-tests.ts b/to-title-case-gouch/to-title-case-gouch-tests.ts similarity index 77% rename from to-title-case/to-title-case-tests.ts rename to to-title-case-gouch/to-title-case-gouch-tests.ts index 2dc1fd9f57..80f8242894 100644 --- a/to-title-case/to-title-case-tests.ts +++ b/to-title-case-gouch/to-title-case-gouch-tests.ts @@ -3,7 +3,7 @@ import fs = require('fs'); -fs.readFile('to-title-case.min.js', 'utf-8', function(err: any, code: string) { +fs.readFile('to-title-case.js', 'utf-8', function(err: any, code: string) { eval(code); var lowerCase: string = 'this title is in lowercase and will be title case'; console.log(lowerCase.toTitleCase()); // Now in title case. diff --git a/to-title-case/to-title-case.d.ts b/to-title-case-gouch/to-title-case-gouch.d.ts similarity index 100% rename from to-title-case/to-title-case.d.ts rename to to-title-case-gouch/to-title-case-gouch.d.ts From a99412d02a48afdda97ce3f95e38ce5f567d1e56 Mon Sep 17 00:00:00 2001 From: Sam Saint-Pettersen Date: Sun, 19 Jul 2015 14:47:28 +0100 Subject: [PATCH 3/3] Update to-title-case-gouch-tests.ts --- to-title-case-gouch/to-title-case-gouch-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/to-title-case-gouch/to-title-case-gouch-tests.ts b/to-title-case-gouch/to-title-case-gouch-tests.ts index 80f8242894..68e0a616b0 100644 --- a/to-title-case-gouch/to-title-case-gouch-tests.ts +++ b/to-title-case-gouch/to-title-case-gouch-tests.ts @@ -1,5 +1,5 @@ /// -/// +/// import fs = require('fs');