import type { Parser , ScopeTransform } from "../api.js" ; import { xform } from "../combinators/xform.js" ; /**
 * Stores number of children as result, then discards children. Also see
 *  count .
 *
 *  param scope export const xfCount = ( scope ) => { scope ! . result = scope ! . children ? scope ! . children . length : 0 ; scope ! . children = null ; return scope ; } ; param parser export const count = < T > ( parser ) => xform ( parser , xfCount ) ;