From 5f4251b0b2e5b33c50df11e5d74092818e4cb3e2 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sat, 14 Mar 2020 14:22:08 +0800 Subject: [PATCH] Only use a CommonJS export for the TypeScript definition Reason: https://github.com/sindresorhus/mem/issues/31 --- index.d.ts | 9 --------- index.js | 2 -- 2 files changed, 11 deletions(-) diff --git a/index.d.ts b/index.d.ts index 6d535ce..c5a6ee1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -82,8 +82,6 @@ declare namespace onChange { } declare const onChange: { - default: typeof onChange; - /** Watch an object or array for changes. It works recursively, so it will even detect if you modify a deep property like `obj.a.b[0].c = true`. @@ -168,13 +166,6 @@ declare const onChange: { options?: onChange.Options ): ObjectType; - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function onChange( - // object: ObjectType, - // onChange: (this: ObjectType, path: string, value: unknown, previousValue: unknown) => void - // ): ObjectType; - // export = onChange; - /** @param object - Object that is already being watched for changes. @returns The original unwatched object. diff --git a/index.js b/index.js index b8e6739..613a1cf 100644 --- a/index.js +++ b/index.js @@ -300,5 +300,3 @@ onChange.target = proxy => proxy[TARGET] || proxy; onChange.unsubscribe = proxy => proxy[UNSUBSCRIBE] || proxy; module.exports = onChange; -// TODO: Remove this for the next major release -module.exports.default = onChange;