Repository: blitz-js/superjson
Pull request #156 (2021-10-18 14:49:26)

docs: add tomhooijenga as a contributor for bug, code
Add @tomhooijenga as a contributor for bug, code.

This was requested by Skn0tt [in this comment](https://github.com/blitz-js/superjson/pull/155#issuecomment-945855060)


Patch:
diff --git a/.all-contributorsrc b/.all-contributorsrc
index ce4e845..492b313 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -63,7 +63,8 @@
       "avatar_url": "https://avatars0.githubusercontent.com/u/1853235?v=4",
       "profile": "https://github.com/tomhooijenga",
       "contributions": [
-        "code"
+        "code",
+        "bug"
       ]
     },
     {
diff --git a/README.md b/README.md
index 4b678fe..e767c05 100644
--- a/README.md
+++ b/README.md
@@ -257,7 +257,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
     <td align="center"><a href="https://twitter.com/flybayer"><img src="https://avatars3.githubusercontent.com/u/8813276?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Brandon Bayer</b></sub></a><br /><a href="#ideas-flybayer" title="Ideas, Planning, & Feedback">🤔</a></td>
     <td align="center"><a href="http://jeremyliberman.com/"><img src="https://avatars3.githubusercontent.com/u/2754163?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Jeremy Liberman</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=mrleebo" title="Tests">⚠️</a> <a href="https://github.com/blitz-js/superjson/commits?author=mrleebo" title="Code">💻</a></td>
     <td align="center"><a href="https://github.com/jorisre"><img src="https://avatars1.githubusercontent.com/u/7545547?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Joris</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=jorisre" title="Code">💻</a></td>
-    <td align="center"><a href="https://github.com/tomhooijenga"><img src="https://avatars0.githubusercontent.com/u/1853235?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tomhooijenga</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=tomhooijenga" title="Code">💻</a></td>
+    <td align="center"><a href="https://github.com/tomhooijenga"><img src="https://avatars0.githubusercontent.com/u/1853235?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tomhooijenga</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=tomhooijenga" title="Code">💻</a> <a href="https://github.com/blitz-js/superjson/issues?q=author%3Atomhooijenga" title="Bug reports">🐛</a></td>
     <td align="center"><a href="https://twitter.com/ftonato"><img src="https://avatars2.githubusercontent.com/u/5417662?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ademílson F. Tonato</b></sub></a><br /><a href="https://github.com/blitz-js/superjson/commits?author=ftonato" title="Tests">⚠️</a></td>
   </tr>
   <tr>
diff --git a/package.json b/package.json
index 55ec252..dc7b1d0 100644
--- a/package.json
+++ b/package.json
@@ -68,8 +68,7 @@
     "typescript": "^4.2.4"
   },
   "dependencies": {
-    "copy-anything": "^3.0.2",
-    "debug": "^4.3.1"
+    "copy-anything": "^3.0.2"
   },
   "resolutions": {
     "**/@typescript-eslint/eslint-plugin": "^4.11.1",
diff --git a/src/registry.ts b/src/registry.ts
index 236ef22..4b66e63 100644
--- a/src/registry.ts
+++ b/src/registry.ts
@@ -1,7 +1,4 @@
 import { DoubleIndexedKV } from './double-indexed-kv';
-import createDebug from 'debug';
-
-const debug = createDebug('superjson');
 
 export class Registry<T> {
   private kv = new DoubleIndexedKV<string, T>();
@@ -20,7 +17,9 @@ export class Registry<T> {
     if (process.env.NODE_ENV !== 'production') {
       const alreadyRegistered = this.kv.getByKey(identifier);
       if (alreadyRegistered && alreadyRegistered !== value) {
-        debug(`Ambiguous class "${identifier}", provide a unique identifier.`);
+        console.debug(
+          `Ambiguous class "${identifier}", provide a unique identifier.`
+        );
       }
     }
 
diff --git a/yarn.lock b/yarn.lock
index cf56728..73565c4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2555,13 +2555,6 @@ debug@^4.0.1, debug@^4.1.0, debug@^4.1.1:
   dependencies:
     ms "^2.1.1"
 
-debug@^4.3.1:
-  version "4.3.1"
-  resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee"
-  integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==
-  dependencies:
-    ms "2.1.2"
-
 decamelize@^1.2.0:
   version "1.2.0"
   resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz"
@@ -4915,7 +4908,7 @@ ms@2.0.0:
   resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz"
   integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
 
-ms@2.1.2, ms@^2.1.1:
+ms@^2.1.1:
   version "2.1.2"
   resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz"
   integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==


Test patch:
diff --git a/src/registry.test.ts b/src/registry.test.ts
index 0538929..ec450d2 100644
--- a/src/registry.test.ts
+++ b/src/registry.test.ts
@@ -1,4 +1,3 @@
-import debug from 'debug';
 import { Registry } from './registry';
 import { Class } from './types';
 
@@ -17,8 +16,7 @@ test('class registry', () => {
 
   expect(() => registry.register(Car)).not.toThrow();
 
-  debug.enable('superjson');
-  const warnSpy = jest.spyOn(process.stderr, 'write');
+  const warnSpy = jest.spyOn(console, 'debug');
 
   registry.register(class Car {});
   expect(warnSpy).toHaveBeenCalledTimes(1);