import type { Predicate } from "@thi.ng/api" ; import type { Parser } from "../api.js" ; example param pred export const skipWhile = < T > ( pred ) : Parser < T > => ( ctx ) => { const state = { ... ctx . state } ; const reader = ctx . reader ; while ( ! state . done ) { if ( ! pred ( reader . read ( state ) ) ) break ; reader . next ( state ) ; } ctx . state = state ; return true ; } ;