import type { IObjectOf } from "@thi.ng/api" ; import { illegalArgs } from "@thi.ng/errors/illegal-arguments" ; import type { Implementation , MultiFn } from "./api.js" ; remarks example param id param impls export const implementations = ( id , rels , ... impls ) => { impls . length & 1 && illegalArgs ( "expected an even number of implementation items" ) ; if ( rels ) { for ( let parent in rels ) { for ( let fn of rels [ parent ] ) { fn . isa ( id , parent ) ; } } } for ( let i = 0 ; i < impls . length ; i += 2 ) { ( < MultiFn < any > > impls [ i ] ) . add ( id , impls [ i + 1 ] ) ; } } ;