chore: remove upcast

This commit is contained in:
Alexis Tyler
2021-03-03 14:26:32 +10:30
parent 6f210e311b
commit efbe4e7b0e

View File

@@ -1,7 +1,6 @@
import { upcast } from './upcast';
export const toBoolean = (value: any): boolean => upcast.to(value, 'boolean');
export const toNumber = (value: any): number => upcast.to(value, 'number');
// If it's "true", "yes" or "1" then it's true otherwise it's false
export const toBoolean = (value: string): boolean => value.toLowerCase().trim() === 'true' || value.toLowerCase().trim() === 'yes' || value === '1';
export const toNumber = (value: string): number => parseInt(value, 10);
type BooleanString = 'true' | 'false';