Skip to content

Commit 65e8c65

Browse files
committed
Map WebIDL object to TypeScript object
This type on the TS side is relatively new, which is probably why it wasn't used in the first place, but gives more precise definitions and, so, better type checking. As a side-effect, fixes #290 (although in a different way).
1 parent 353a0cf commit 65e8c65

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/helpers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ export const bufferSourceTypes = new Set(["ArrayBuffer", "ArrayBufferView", "Dat
55
export const integerTypes = new Set(["byte", "octet", "short", "unsigned short", "long", "unsigned long", "long long", "unsigned long long"]);
66
export const stringTypes = new Set(["ByteString", "DOMString", "USVString", "CSSOMString"]);
77
const floatTypes = new Set(["float", "unrestricted float", "double", "unrestricted double"]);
8-
const sameTypes = new Set(["any", "boolean", "Date", "Function", "Promise", "void"]);
8+
const sameTypes = new Set(["any", "boolean", "object", "Date", "Function", "Promise", "void"]);
99
export const baseTypeConversionMap = new Map<string, string>([
1010
...[...bufferSourceTypes].map(type => [type, type] as [string, string]),
1111
...[...integerTypes].map(type => [type, "number"] as [string, string]),
1212
...[...floatTypes].map(type => [type, "number"] as [string, string]),
1313
...[...stringTypes].map(type => [type, "string"] as [string, string]),
1414
...[...sameTypes].map(type => [type, type] as [string, string]),
15-
["object", "any"],
1615
["sequence", "Array"],
1716
["record", "Record"],
1817
["FrozenArray", "ReadonlyArray"],

0 commit comments

Comments
 (0)