Skip to content

Commit 2cd46bc

Browse files
authored
Add type definitions for TypeScript users (#74)
1 parent b85aec2 commit 2cd46bc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/url-join.d.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Join all arguments together and normalize the resulting url.
3+
* This works similar to `path.join` but you shouldn't use `path.join` for urls since it works
4+
* differently depending on the operating system and also doesn't work for some cases.
5+
*/
6+
declare function urlJoin(...parts: string[]): string;
7+
declare function urlJoin(parts: string[]): string;
8+
9+
export = urlJoin;

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "4.0.1",
44
"description": "Join urls and normalize as in path.join.",
55
"main": "lib/url-join.js",
6+
"types": "lib/url-join.d.ts",
67
"scripts": {
78
"test": "mocha --require should"
89
},

0 commit comments

Comments
 (0)