From 67ec3d5b5521422a4d04a61fae40c4ed569b6e52 Mon Sep 17 00:00:00 2001 From: Mike Deverell Date: Fri, 17 Feb 2017 14:54:25 -0500 Subject: [PATCH 1/6] make url-join compatible with `import * as` syntax --- url-join/index.d.ts | 9 ++++++--- url-join/tsconfig.json | 3 ++- url-join/url-join-import-star-tests.ts | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 url-join/url-join-import-star-tests.ts diff --git a/url-join/index.d.ts b/url-join/index.d.ts index 82715e643e..d8b28dc28a 100644 --- a/url-join/index.d.ts +++ b/url-join/index.d.ts @@ -6,7 +6,10 @@ /** * Join all arguments together and normalize the resulting url. * This works similar to path.join but you shouldn't use path.join for urls since it will work different depending of the operative systems but also doesn't work for some cases. - */ -declare function urljoin(...parts: string[]): string; + */ -export = urljoin; +declare var urljoin: (...parts: string[]) => string; + +declare module "url-join" { + export = urljoin; +} diff --git a/url-join/tsconfig.json b/url-join/tsconfig.json index 3f89e8f618..c06ca4b0a2 100644 --- a/url-join/tsconfig.json +++ b/url-join/tsconfig.json @@ -17,6 +17,7 @@ }, "files": [ "index.d.ts", - "url-join-tests.ts" + "url-join-tests.ts", + "url-join-import-star-tests.ts" ] } \ No newline at end of file diff --git a/url-join/url-join-import-star-tests.ts b/url-join/url-join-import-star-tests.ts new file mode 100644 index 0000000000..cba06cb99a --- /dev/null +++ b/url-join/url-join-import-star-tests.ts @@ -0,0 +1,3 @@ +import * as urljoin from "url-join"; + +const s: string = urljoin("foo", "bar", "baz"); From efc370a9936403a4fc359df969efb2bed97db74f Mon Sep 17 00:00:00 2001 From: Mike Deverell Date: Sat, 18 Feb 2017 09:17:20 -0500 Subject: [PATCH 2/6] add myself to url-join contributors list --- url-join/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url-join/index.d.ts b/url-join/index.d.ts index d8b28dc28a..3dc87d456f 100644 --- a/url-join/index.d.ts +++ b/url-join/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for url-join v0.8.3 // Project: https://github.com/jfromaniello/url-join -// Definitions by: Rogier Schouten +// Definitions by: Rogier Schouten , Mike Deverell // Definitions: https://github.com/borisyankov/DefinitelyTyped /** From 8adf2de80de6aafcaadb77d8ad3c46660b2a249c Mon Sep 17 00:00:00 2001 From: Mike Deverell Date: Tue, 21 Feb 2017 10:40:56 -0500 Subject: [PATCH 3/6] remove url-join-import-start-tests.ts - only one test file is supported --- url-join/url-join-import-star-tests.ts | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 url-join/url-join-import-star-tests.ts diff --git a/url-join/url-join-import-star-tests.ts b/url-join/url-join-import-star-tests.ts deleted file mode 100644 index cba06cb99a..0000000000 --- a/url-join/url-join-import-star-tests.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as urljoin from "url-join"; - -const s: string = urljoin("foo", "bar", "baz"); From 86ef965325d8b0329a178624358785f6cb110799 Mon Sep 17 00:00:00 2001 From: Mike Deverell Date: Tue, 21 Feb 2017 10:41:37 -0500 Subject: [PATCH 4/6] test `import * as` syntax inside existing test file --- url-join/url-join-tests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/url-join/url-join-tests.ts b/url-join/url-join-tests.ts index 182b44359e..2b512bc6d4 100644 --- a/url-join/url-join-tests.ts +++ b/url-join/url-join-tests.ts @@ -1,4 +1,5 @@ - import urljoin = require("url-join"); +import * as urljoin2 from "url-join"; const s: string = urljoin("foo", "bar", "baz"); +const s2: string = urljoin2("foo", "bar", "baz"); From ed06a7982c3b47add013955758bae67001a00e59 Mon Sep 17 00:00:00 2001 From: Mike Deverell Date: Tue, 21 Feb 2017 10:47:46 -0500 Subject: [PATCH 5/6] remove url-join-import-star-tests.ts from tsconfig.json --- url-join/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/url-join/tsconfig.json b/url-join/tsconfig.json index c06ca4b0a2..9c6b8dce07 100644 --- a/url-join/tsconfig.json +++ b/url-join/tsconfig.json @@ -18,6 +18,5 @@ "files": [ "index.d.ts", "url-join-tests.ts", - "url-join-import-star-tests.ts" ] } \ No newline at end of file From 22ed2445bc8f3881986c2be9b2c21a0a41169269 Mon Sep 17 00:00:00 2001 From: Mike Deverell Date: Tue, 21 Feb 2017 10:51:50 -0500 Subject: [PATCH 6/6] fix json --- url-join/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/url-join/tsconfig.json b/url-join/tsconfig.json index 9c6b8dce07..3f89e8f618 100644 --- a/url-join/tsconfig.json +++ b/url-join/tsconfig.json @@ -17,6 +17,6 @@ }, "files": [ "index.d.ts", - "url-join-tests.ts", + "url-join-tests.ts" ] } \ No newline at end of file