waygraph / modVerify
Function: modVerify()
modVerify<
In,Out>(block,nameOrIndex,newCheck):DefinedBlock<In,Out>
Defined in: src/engine/block/block.ts:450
Replaces one Trait inside block's verify list, leaving every other check untouched - the v1/v2/legacy-variant case, where one check needs a different selector or URL pattern but the rest of the Block is identical. Addressed by the Trait's own name (recommended - inserting or reordering other checks can't silently retarget it) or, if you genuinely know the position and don't need that safety, a numeric index. Either way a bad address fails loud immediately instead of quietly doing nothing. newCheck can be a bare check function (keeps the existing name) or a full Trait (to rename too). Only works on a flat verify array - a function-form verify (from verify: (out) => Trait[]) has no fixed list to address into, so this throws rather than guess; use withVerify to replace it wholesale instead.
Type Parameters
In
In extends Checkpoint<string>
Out
Out extends Checkpoint<string>
Parameters
block
Block<In, Out>
nameOrIndex
string | number
newCheck
Trait | ((page, mem) => Promise<boolean | TraitResult>)
Function
(page, mem) => Promise<boolean | TraitResult>
Returns
DefinedBlock<In, Out>