import type { Parser , ScopeTransform } from "../api.js" ; import { xform } from "../combinators/xform.js" ; /**
 * HOF scope transform which replaces a node's result with given pre-configured
 * value and discards node's children. Also see  replace .
 *
 *  param result export const xfReplace = < T > ( result ) : ScopeTransform < T > => ( scope ) => { scope ! . result = result ; scope ! . children = null ; return scope ; } ; param parser param result export const replace = < T > ( parser , result ) => xform ( parser , xfReplace ( result ) ) ;