From 03411d8822351cf6f55ba0ac02fba648614242ac Mon Sep 17 00:00:00 2001 From: karooolis Date: Mon, 7 Oct 2024 14:02:25 +0300 Subject: [PATCH] use isDefined --- packages/world/ts/getWorldAbi.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/world/ts/getWorldAbi.ts b/packages/world/ts/getWorldAbi.ts index 0c66f32c20..919471b34a 100644 --- a/packages/world/ts/getWorldAbi.ts +++ b/packages/world/ts/getWorldAbi.ts @@ -2,6 +2,7 @@ import { Client, Abi, AbiItem, AbiFunction, Address, getAddress, toFunctionSelec import IBaseWorldAbi from "../out/IBaseWorld.sol/IBaseWorld.abi.json"; import { functionSignatureToAbiItem } from "./functionSignatureToAbiItem"; import { getFunctions } from "./getFunctions"; +import { isDefined } from "@latticexyz/common/utils"; function isAbiFunction(abiItem: AbiItem): abiItem is AbiFunction { return abiItem.type === "function"; @@ -33,9 +34,8 @@ export async function getWorldAbi({ console.error(error); } }) - .filter( - (abiItem): abiItem is AbiFunction => !!abiItem && !baseFunctionSelectors.includes(toFunctionSelector(abiItem)), - ); + .filter(isDefined) + .filter((abiItem) => !baseFunctionSelectors.includes(toFunctionSelector(abiItem))); const abi = [...IBaseWorldAbi, ...worldFunctionsAbi]; return abi;