// deno-fmt-ignore-file
import { Arguments } from '../../system/arguments/index.mjs';
import { FromType } from './from_type.mjs';
/**
 * Converts a value to the given type, coercing interior values if a reasonable conversion is possible. This
 * function returns unknown so callers should Check the return value before use. This function mutates the
 * provided value. If mutation is not wanted, you should Clone the value before passing to this function.
 */
export function Convert(...args) {
    const [context, type, value] = Arguments.Match(args, {
        3: (context, type, value) => [context, type, value],
        2: (type, value) => [{}, type, value],
    });
    return FromType(context, type, value);
}
