From 64d3e583efea0c607c52681099df86416f693535 Mon Sep 17 00:00:00 2001 From: chad Date: Fri, 2 Jun 2023 14:04:33 -0500 Subject: [PATCH] fix: specify updated formatter for multiaddrs (#35) --- src/index.ts | 2 +- test/index.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9eca432..26bca95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,7 +38,7 @@ debug.formatters.k = (v: Key): string => { } // Add a formatter for stringifying Multiaddrs -debug.formatters.ma = (v?: Multiaddr): string => { +debug.formatters.a = (v?: Multiaddr): string => { return v == null ? 'undefined' : v.toString() } diff --git a/test/index.spec.ts b/test/index.spec.ts index abd82be..7736563 100644 --- a/test/index.spec.ts +++ b/test/index.spec.ts @@ -70,13 +70,13 @@ describe('logger', () => { expect(debug.formatters).to.have.property('p').that.is.a('function') expect(debug.formatters).to.have.property('c').that.is.a('function') expect(debug.formatters).to.have.property('k').that.is.a('function') - expect(debug.formatters).to.have.property('ma').that.is.a('function') + expect(debug.formatters).to.have.property('a').that.is.a('function') }) it('test ma formatter', () => { const ma = multiaddr('/ip4/127.0.0.1/tcp/4001') - expect(debug.formatters.ma(ma)).to.equal(ma.toString()) + expect(debug.formatters.a(ma)).to.equal(ma.toString()) }) it('test peerId formatter', () => {