mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +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);
|
|
};
|