Skip to content

Commit 6b64c4f

Browse files
authored
Merge pull request DefinitelyTyped#16025 from slawiko/16023-cookiejs-renaming
16023: creates second types folder for those, who uses npm package co…
2 parents ae87ff9 + 1cb14bc commit 6b64c4f

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

types/cookiejs/cookiejs-tests.ts types/cookie_js/cookie_js-tests.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
2-
3-
// Based on https://github.com/js-coder/cookie.js/blob/gh-pages/tests/spec.js
4-
5-
import cookie = require("cookiejs");
1+
import cookie = require("cookie_js");
62

73
cookie.set({a: '1', b: '2', c: '3'});
84

types/cookiejs/index.d.ts types/cookie_js/index.d.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
// Type definitions for cookie.js v1.2.2
1+
// Type definitions for cookie_js v1.2.2
22
// Project: https://github.com/florian/cookie.js
3-
// Definitions by: Boltmade <https://github.com/Boltmade>
3+
// Definitions by: slawiko <https://github.com/slawiko>
44
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+
declare module 'cookie_js' {
7+
export = cookie;
8+
}
9+
510
/**
6-
* Shortcut for cookie.get()
11+
* https://github.com/DefinitelyTyped/DefinitelyTyped/pull/16025#issuecomment-295784660
712
*/
8-
9-
export = cookie;
10-
export as namespace cookie;
13+
declare module 'cookiejs' {
14+
export = cookie;
15+
}
1116

1217
declare function cookie(key : string, fallback?: string) : string;
1318
declare function cookie(keys : string[], fallback?: string) : string;

types/cookiejs/tsconfig.json types/cookie_js/tsconfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
],
77
"noImplicitAny": true,
88
"noImplicitThis": true,
9-
"strictNullChecks": false,
9+
"strictNullChecks": true,
1010
"baseUrl": "../",
1111
"typeRoots": [
1212
"../"
@@ -17,6 +17,6 @@
1717
},
1818
"files": [
1919
"index.d.ts",
20-
"cookiejs-tests.ts"
20+
"cookie_js-tests.ts"
2121
]
22-
}
22+
}

0 commit comments

Comments
 (0)