mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
11 lines
232 B
TypeScript
11 lines
232 B
TypeScript
// Loaded from https://deno.land/x/segno@v1.1.0/lib/helpers/toFloat.ts
|
|
|
|
|
|
import { isFloat } from '../validations/isFloat.ts';
|
|
|
|
export const toFloat = (str: string) => {
|
|
if (!isFloat(str)) return NaN;
|
|
|
|
return parseFloat(str);
|
|
};
|