import type { Fn , Fn3 , Nullable , Pair } from "@thi.ng/api" ; internal export const CMP = ( a , b ) => b [ 0 ] - a [ 0 ] ; internal export const addResults = < A , B > ( fn , sel , acc ) => { for ( let n = sel . sort ( CMP ) . length ; n -- > 0 ; ) { const s = sel [ n ] [ 1 ] ; s && acc . push ( fn ( s ) ) ; } return acc ; } ; param map param pairs param eps internal export const into = < K , V > ( map , pairs , eps ) => { let ok = true ; for ( let p of pairs ) { ok = map . set ( p [ 0 ] , p [ 1 ] , eps ) && ok ; } return ok ; } ;