From 93b1c081bd90428360069b7887cd46cbd87934cc Mon Sep 17 00:00:00 2001 From: CJ42 Date: Tue, 28 May 2024 15:25:37 +0200 Subject: [PATCH] chore: fix linter and remove accidentally commited file --- src/lib/Untitled-1 | 23 ----------------------- src/lib/decodeData.ts | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 src/lib/Untitled-1 diff --git a/src/lib/Untitled-1 b/src/lib/Untitled-1 deleted file mode 100644 index 4ec309a2..00000000 --- a/src/lib/Untitled-1 +++ /dev/null @@ -1,23 +0,0 @@ -import { ERC725 } from '@erc725/erc725.js'; - -const schema = [ - { - name: 'LSP3Profile', - key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5', - keyType: 'Singleton', - valueType: 'bytes', - valueContent: 'VerifiableURI', - }, -]; - -const erc725 = new ERC725(schema); -const encodedVerifiableURI = - '0x00008019f9b10020ed9808e44f28535d4673424413c06ce26210077628eddf95da6acba96f0b9e25697066733a2f2f6261666b72656967706176746475357035796d6a637a62346a35696d3434326f6e76336735693767747a6b6c3234336e3763616e71796d646e6334'; - -const result = erc725.decodeData([ - { - keyName: 'LSP3Profile', - value: encodedVerifiableURI, - }, -]); -console.log(JSON.stringify(result, null, 4)); diff --git a/src/lib/decodeData.ts b/src/lib/decodeData.ts index 59604dc1..a6b7cefd 100644 --- a/src/lib/decodeData.ts +++ b/src/lib/decodeData.ts @@ -196,7 +196,7 @@ export function decodeKey(schema: ERC725JSONSchema, value) { switch (lowerCaseKeyType) { case 'array': { // If user has requested a key which does not exist in the contract, value will be: 0x and value.find() will fail. - if (!value || value == '0x') { + if (!value || value === '0x') { return []; }