import { illegalArity } from "@thi.ng/errors/illegal-arity" ; import type { Implementation } from "./api.js" ; import { DEFAULT , defmulti } from "./defmulti.js" ; remarks Internally uses  {@link (defmulti:1)} , so new arities can be dynamically
 * added (or removed) at a later time. If no `fallback` is provided,
 * `defmultiN` also registers a  DEFAULT implementation which
 * simply throws an  {@link @thi.ng/errors#IllegalArityError} when
 * invoked.
 *
 * **Note:** Unlike  {@link (defmulti:1)} no argument type checking is
 * supported, however you can specify the return type for the generated
 * function.
 *
 *  example param impls param fallback export const defmultiN = < T > ( impls , fallback ? ) => { const fn = defmulti < T > ( ( ... args ) => args . length ) ; fn . add ( DEFAULT , fallback || ( ( ... args ) => illegalArity ( args . length ) ) ) ; for ( let id in impls ) { fn . add ( id , impls [ id ] ) ; } return fn ; } ;