From efd88c4d351c3bc52adeddc29adc9ab0899fdba4 Mon Sep 17 00:00:00 2001 From: Dmytro Parzhytskyi Date: Wed, 15 Oct 2025 14:18:37 +0300 Subject: [PATCH 1/3] Fix `exports` map after build tool update --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c1019ae..ea4cbe4 100644 --- a/package.json +++ b/package.json @@ -31,26 +31,26 @@ "LICENSE" ], "main": "./dist/cjs/index.cjs", - "types": "./dist/esm/index.d.ts", + "types": "./dist/index.d.ts", "module": "./dist/esm/index.js", "exports": { ".": { "import": { - "types": "./dist/esm/index.d.ts", + "types": "./dist/index.d.ts", "default": "./dist/esm/index.js" }, "require": { - "types": "./dist/esm/index.d.ts", + "types": "./dist/index.d.ts", "default": "./dist/cjs/index.cjs" } }, "./promises": { "import": { - "types": "./dist/esm/promises.d.ts", + "types": "./dist/promises.d.ts", "default": "./dist/esm/promises.js" }, "require": { - "types": "./dist/esm/promises.d.ts", + "types": "./dist/promises.d.ts", "default": "./dist/cjs/promises.cjs" } } From ddc8446fe26f958c643388c84beed4da4ef69b35 Mon Sep 17 00:00:00 2001 From: Dmytro Parzhytskyi Date: Wed, 15 Oct 2025 14:18:42 +0300 Subject: [PATCH 2/3] Remove console.log --- vite.config.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 328415f..cd0a8f0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -15,8 +15,6 @@ export default defineConfig({ promises: resolve('src/promises.ts'), }, fileName(format, entryName) { - console.log({ format, entryName }) - if (format === 'es') { return `esm/${entryName}.js` } From b9450a2081efaa3305d2ca38ecdf6b0276d3e658 Mon Sep 17 00:00:00 2001 From: Dmytro Parzhytskyi Date: Wed, 15 Oct 2025 14:37:37 +0300 Subject: [PATCH 3/3] =?UTF-8?q?Add=20forgotten=20`clear=5F=5F=5F(=E2=80=A6?= =?UTF-8?q?)`=20exports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.spec.ts | 14 +++++++++----- src/index.ts | 5 +++++ src/promises.spec.ts | 14 +++++++++----- src/promises.ts | 5 +++++ 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/index.spec.ts b/src/index.spec.ts index 394b5cb..667f178 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -3,18 +3,22 @@ export {} const indexfile = await import('./index') describe('indexfile', () => { - it('should export `setInterval(…)` function', () => { - expect(indexfile).toHaveProperty('setInterval', expect.any(Function)) - }) - it('should export `setRecursive(…)` function', () => { expect(indexfile).toHaveProperty('setRecursive', expect.any(Function)) }) - it('should export the same function under the aliases `setInterval` and `setRecursive`', () => { + it('should export `setRecursive(…)` under the alias `setInterval(…)`', () => { expect(indexfile.setInterval === indexfile.setRecursive).toBe(true) }) + it('should export `clearRecursive(…)` function', () => { + expect(indexfile).toHaveProperty('clearRecursive', expect.any(Function)) + }) + + it('should export `clearRecursive(…)` under the alias `clearInterval(…)`', () => { + expect(indexfile.clearInterval === indexfile.clearRecursive).toBe(true) + }) + it('should export `promises` namespace', () => { expect(indexfile).toHaveProperty('promises', expect.any(Object)) }) diff --git a/src/index.ts b/src/index.ts index c14c451..5564185 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,3 +6,8 @@ export { createRecursiveTimeout as setRecursive, createRecursiveTimeout as setInterval, // alias (allows drop-in replacement) } from './with-callback/create-recursive-timeout' + +export { + clearRecursiveTimeout as clearRecursive, + clearRecursiveTimeout as clearInterval, // alias (allows drop-in replacement) +} from './with-callback/clear-recursive-timeout' diff --git a/src/promises.spec.ts b/src/promises.spec.ts index 2681480..c160760 100644 --- a/src/promises.spec.ts +++ b/src/promises.spec.ts @@ -3,15 +3,19 @@ export {} const promises = await import('./promises') describe('indexfile', () => { - it('should export `setInterval(…)` function', () => { - expect(promises).toHaveProperty('setInterval', expect.any(Function)) - }) - it('should export `setRecursive(…)` function', () => { expect(promises).toHaveProperty('setRecursive', expect.any(Function)) }) - it('should export the same function under the aliases `setInterval` and `setRecursive`', () => { + it('should export `setRecursive(…)` under the alias `setInterval(…)`', () => { expect(promises.setInterval === promises.setRecursive).toBe(true) }) + + it('should export `clearRecursive(…)` function', () => { + expect(promises).toHaveProperty('clearRecursive', expect.any(Function)) + }) + + it('should export `clearRecursive(…)` under the alias `clearInterval(…)`', () => { + expect(promises.clearInterval === promises.clearRecursive).toBe(true) + }) }) diff --git a/src/promises.ts b/src/promises.ts index 18cc7cf..4315b73 100644 --- a/src/promises.ts +++ b/src/promises.ts @@ -2,3 +2,8 @@ export { createRecursiveTimeout as setRecursive, createRecursiveTimeout as setInterval, // alias (allows drop-in replacement) } from './with-promises/create-recursive-timeout' + +export { + clearRecursiveTimeout as clearRecursive, + clearRecursiveTimeout as clearInterval, // alias (allows drop-in replacement) +} from './with-promises/clear-recursive-timeout'