Skip to content

Commit c381141

Browse files
committed
fix(module syntax): added interop with cjs syntax
1 parent 4ff03a2 commit c381141

5 files changed

Lines changed: 5 additions & 6 deletions

File tree

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
index.ts

index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
declare type NodeId = string;
22
declare type EdgeWeight = number;
3-
declare type EncodedEdge = string;
43
interface Serialized {
54
nodes: {
65
id: NodeId;
@@ -31,4 +30,4 @@ declare function Graph(serialized?: Serialized): {
3130
serialize: () => Serialized;
3231
deserialize: (serialized: Serialized) => any;
3332
};
34-
//# sourceMappingURL=index.d.ts.map
33+
export = Graph;

index.d.ts.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,4 +396,4 @@ function Graph(serialized?: Serialized) {
396396
// The returned graph instance.
397397
return graph;
398398
}
399-
module.exports = Graph;
399+
export = Graph;

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"allowJs": false,
44
"declaration": true,
55
"esModuleInterop": true,
6-
"declarationMap": true,
76
"module": "CommonJS",
87
"noImplicitAny": true,
98
"noImplicitReturns": true,
@@ -12,7 +11,8 @@
1211
"target": "ES5",
1312
"strictFunctionTypes": true,
1413
"strictNullChecks": true,
15-
"downlevelIteration": true
14+
"downlevelIteration": true,
15+
"isolatedModules": true
1616
},
1717
"file": ["index.ts"],
1818
"exclude": ["node_modules", "*.d.ts"]

0 commit comments

Comments
 (0)