Skip to content

Commit

Permalink
use isDefined
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Oct 7, 2024
1 parent 4072e71 commit 03411d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/world/ts/getWorldAbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 03411d8

Please sign in to comment.