From e0831733f112cfe7f3bb0f67c816387e8ac8e04d Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Sun, 29 Jan 2023 18:05:56 +0100 Subject: [PATCH 1/2] Use CommonJS export for "module": "node16" The change in https://github.com/simov/slugify/pull/19 to switch to an ESM-style export seemed like the right solution at the time. However, module systems have evolved since then and the `export default` fails when "module": "node16" is configured in tsconfig.json Since `slugify` is a CommonJS module, it seems like using a CommonJS-style export is indeed the right choice for this package. --- slugify.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slugify.d.ts b/slugify.d.ts index e20f795..4d0dc90 100644 --- a/slugify.d.ts +++ b/slugify.d.ts @@ -21,4 +21,4 @@ declare function slugify( ): string; -export default slugify; +export = slugify; From b443c79b89ec6700513afcb70973258d438ef76a Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Wed, 1 Feb 2023 12:39:25 +0100 Subject: [PATCH 2/2] Add UMD wrapper --- slugify.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slugify.d.ts b/slugify.d.ts index 4d0dc90..0f4b328 100644 --- a/slugify.d.ts +++ b/slugify.d.ts @@ -4,6 +4,8 @@ declare module slugify { } export function extend (args: ExtendArgs): void; + const _default: typeof slugify; + export { _default as default }; } declare function slugify( @@ -22,3 +24,4 @@ declare function slugify( ): string; export = slugify; +export as namespace slugify;