From a4718ed5abb1fbd63d5bfefe0dbaf427e47958b0 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Wed, 15 Jul 2020 10:00:05 +0200 Subject: [PATCH] chore: address review --- src/record/README.md | 6 +++--- src/record/index.js | 4 ++-- src/record/tests/index.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/record/README.md b/src/record/README.md index 4f13d27f9..aaca9cd8f 100644 --- a/src/record/README.md +++ b/src/record/README.md @@ -44,7 +44,7 @@ class PeerRecord extends Record { // Implement and return using Protobuf } - isEqual (other) { + equals (other) { // Verify } } @@ -62,9 +62,9 @@ Marshal a record to be used in a libp2p envelope. It returns a `Protobuf` containing the record data. -### isEqual +### equals -- `record.isEqual(other)` +- `record.equals(other)` Verifies if the other Record is identical to this one. diff --git a/src/record/index.js b/src/record/index.js index 022f82321..d8d17dced 100644 --- a/src/record/index.js +++ b/src/record/index.js @@ -27,8 +27,8 @@ class Record { * Verifies if the other provided Record is identical to this one. * @param {Record} other */ - isEqual (other) { - throw errcode(new Error('isEqual must be implemented by the subclass'), 'ERR_NOT_IMPLEMENTED') + equals (other) { + throw errcode(new Error('equals must be implemented by the subclass'), 'ERR_NOT_IMPLEMENTED') } } diff --git a/src/record/tests/index.js b/src/record/tests/index.js index d174080cf..dc0c2f958 100644 --- a/src/record/tests/index.js +++ b/src/record/tests/index.js @@ -28,8 +28,8 @@ module.exports = (test) => { }) it('is able to compare two records', () => { - const isEqual = record.isEqual(record) - expect(isEqual).to.eql(true) + const equals = record.equals(record) + expect(equals).to.eql(true) }) }) }