Motivation (#40091)

Use "export =" syntax instead of "export default" syntax. Because in Node.js environment, ES6 module syntax could not be converted correctly to CommonJS module syntax.

Solution

Use "export =" syntax. Refer to <https://www.typescriptlang.org/docs/handbook/modules.html>
This commit is contained in:
Kyle Chine
2019-11-05 13:34:31 -08:00
committed by Nathan Shively-Sanders
parent fb3c5606ad
commit 65d3b17a6f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -28,4 +28,4 @@ interface UIDGeneratorClass {
declare const UIDGenerator: UIDGeneratorClass;
export { UIDGenerator as default, UIDGeneratorClass, UIDGeneratorInstance };
export = UIDGenerator;
+1 -1
View File
@@ -1,4 +1,4 @@
import { default as UIDGenerator } from 'uid-generator';
import UIDGenerator = require('uid-generator');
new UIDGenerator('abc'); // $ExpectType UIDGeneratorInstance
const generator = new UIDGenerator(128, 'abc'); // $ExpectType UIDGeneratorInstance