From d79ad1e7b172135b80a9a4eee6c2a45306622bf7 Mon Sep 17 00:00:00 2001 From: Bill Barman Date: Thu, 22 Nov 2018 16:40:19 +0800 Subject: [PATCH] rename DIDTo .. didTo --- src/utils/DIDTools.ts | 4 ++-- test/utils/DIDTools.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/DIDTools.ts b/src/utils/DIDTools.ts index 2883ce4..d14638a 100644 --- a/src/utils/DIDTools.ts +++ b/src/utils/DIDTools.ts @@ -121,7 +121,7 @@ export function idToDID(id: string, method?: string): string { * :return a hex string, without the leading '0x' * :return null if the DID is invalid */ -export function DIDToId(did: string): string { +export function didToId(did: string): string { const result = didParse(did) if (result && result.idHex ) { return result.idHex @@ -129,7 +129,7 @@ export function DIDToId(did: string): string { return null } -export function DIDToIdBytes(did: string): Uint8Array { +export function didToIdBytes(did: string): Uint8Array { const result = didParse(did) if (result && result.idHex) { return Web3.utils.hexToBytes("0x" + result.idHex) diff --git a/test/utils/DIDTools.test.ts b/test/utils/DIDTools.test.ts index c021a03..3347928 100644 --- a/test/utils/DIDTools.test.ts +++ b/test/utils/DIDTools.test.ts @@ -68,7 +68,7 @@ describe("DIDTools Tests", () => { const testId = Web3.utils.randomHex(32).substring(2) const testMethod = "op" const validDID = "did:" + testMethod + ":" + testId - assert(didTools.DIDToId(validDID) === testId) + assert(didTools.didToId(validDID) === testId) }) it("should convert an Ocean DID to an array of bytes", async () => { @@ -76,7 +76,7 @@ describe("DIDTools Tests", () => { const byteId = Web3.utils.hexToBytes("0x" + testId) const testMethod = "op" const validDID = "did:" + testMethod + ":" + testId - const bufferTest = Buffer.from(didTools.DIDToIdBytes(validDID)) + const bufferTest = Buffer.from(didTools.didToIdBytes(validDID)) const bufferValid = Buffer.from(byteId) assert(Buffer.compare(bufferTest, bufferValid) === 0 ) })