This commit is contained in:
2021-06-12 17:48:26 +03:00
commit 3e68914c92
56 changed files with 26153 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import {isNumber, isString} from 'lodash';
export const toNumber = (value: unknown): Undefinable<number> => {
if (isNumber(value) || isString(value)) {
const prepareValue = Number(value);
return Number.isNaN(prepareValue) ? undefined : prepareValue;
}
};