swc/bundler/tests/.cache/deno/34258bfe315c2e7dbaff38f7316cbfe31d370014.ts
강동윤 fec189f2f3
fix(bundler): Fix stack overflow on Windows (#1464)
bundler:
 - Prevent stack overflow. (denoland/deno#9752)

testing:
 - Bump version
 - Fix handling of paths on windows.

testing_macros:
 - Bump version
 - Correctly ignore files.
2021-03-22 19:42:42 +09:00

18 lines
463 B
TypeScript

// Loaded from https://deno.land/x/cliffy@v0.18.0/flags/types/number.ts
import type { ITypeHandler, ITypeInfo } from "../types.ts";
/** Number type handler. Excepts any numeric value. */
export const number: ITypeHandler<number> = (
{ label, name, value, type }: ITypeInfo,
): number => {
if (isNaN(Number(value))) {
throw new Error(
`${label} "${name}" must be of type "${type}", but got "${value}".`,
);
}
return parseFloat(value);
};