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;