From 7ce9ab49ee07c9a5ce7b4657185fbad2b8e7ef9f Mon Sep 17 00:00:00 2001 From: CJ42 Date: Tue, 30 Apr 2024 08:23:05 +0100 Subject: [PATCH] chore: fix biome linting errors --- src/lib/schemaParser.test.ts | 6 +++--- src/lib/schemaParser.ts | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/lib/schemaParser.test.ts b/src/lib/schemaParser.test.ts index 9ad23144..8340b89a 100644 --- a/src/lib/schemaParser.test.ts +++ b/src/lib/schemaParser.test.ts @@ -136,7 +136,7 @@ describe('schemaParser getSchema', () => { it('finds known SomeBytes32Mapping:', () => { const bytes32Value = '1111222233334444555566667777888899990000aaaabbbbccccddddeeeeffff'; - const name = `SomeBytes32Mapping:`; + const name = 'SomeBytes32Mapping:'; const dynamicName = `SomeBytes32Mapping:0x${bytes32Value}`; const key = `0x0cfc51aec37c55a4d0b10000${bytes32Value.slice(0, 42)}`; @@ -157,7 +157,7 @@ describe('schemaParser getSchema', () => { it('finds known SomeSelectorMap:', () => { const bytes4Value = 'beefbeef'; - const name = `SomeSelectorMap:`; + const name = 'SomeSelectorMap:'; const dynamicName = `SomeSelectorMap:0x${bytes4Value}`; const key = `0x0cfc51aec37c55a4d0b10000${bytes4Value}00000000000000000000000000000000`; @@ -180,7 +180,7 @@ describe('schemaParser getSchema', () => { describe('MappingWithGrouping', () => { it('finds MappingWithGrouping', () => { const address = 'af3bf2ffb025098b79caddfbdd113b3681817744'; - const name = `AddressPermissions:Permissions:
`; + const name = 'AddressPermissions:Permissions:
'; const dynamicName = `AddressPermissions:Permissions:0x${address}`; const key = `0x4b80742de2bf82acb3630000${address}`; const schema = getSchema(key); diff --git a/src/lib/schemaParser.ts b/src/lib/schemaParser.ts index c8b2dff7..0604c043 100644 --- a/src/lib/schemaParser.ts +++ b/src/lib/schemaParser.ts @@ -125,8 +125,10 @@ const findMappingSchemaForKey = ( // replace dynamic placeholder in the map part (e.g:
, ) with the hex value if (isDynamicKeyName(keySchema.name)) { dynamicPartName = secondWordHex; - result['dynamicName'] = `${keyNameParts[0]}:0x${dynamicPartName}`; - result['dynamicKeyPart'] = `0x${secondWordHex}`; + ( + result as DynamicNameSchema + ).dynamicName = `${keyNameParts[0]}:0x${dynamicPartName}`; + (result as DynamicNameSchema).dynamicKeyPart = `0x${secondWordHex}`; } // if first 20 bytes of the hash of second word in schema match, @@ -153,10 +155,10 @@ const findMappingWithGroupingSchemaForKey = ( const dynamicKeyPart = key.substring(26); if (isDynamicKeyName(keySchema.name)) { - keySchema[ - 'dynamicName' - ] = `${keyNameParts[0]}:${keyNameParts[1]}:0x${dynamicKeyPart}`; - keySchema['dynamicKeyPart'] = `0x${dynamicKeyPart}`; + ( + keySchema as DynamicNameSchema + ).dynamicName = `${keyNameParts[0]}:${keyNameParts[1]}:0x${dynamicKeyPart}`; + (keySchema as DynamicNameSchema).dynamicKeyPart = `0x${dynamicKeyPart}`; } return {