From 36de98fd531e5ee4df0f7f7848337f3890748341 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Wed, 21 Sep 2022 06:32:07 +0100 Subject: [PATCH] feat!: convert to interface (#274) - Renames the `Multiaddr` class to `DefaultMultiaddr` - Exports `Multiaddr` as an interface The `multiaddr` function (introduced in v9.0.0) should be used to create new instances of `Multiaddr` instead of instantiating the `Multiaddr` class directly. This allows us to remove the `inspect` symbol from the interface and avoid use of `Object.defineProperty` which is very slow. Fixes: #202 BREAKING CHANGE: the `Multiaddr` class is now an interface --- README.md | 18 +- src/index.ts | 586 ++++++++++++++++++++++------------------- test/index.spec.ts | 303 ++++++++++----------- test/resolvers.spec.ts | 22 +- 4 files changed, 481 insertions(+), 448 deletions(-) diff --git a/README.md b/README.md index e33e872c..63483565 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ ## Table of contents - [Install](#install) -- [Lead Maintainer](#lead-maintainer) - [Background](#background) - [What is multiaddr?](#what-is-multiaddr) - [Browser: `