UNPKG

@engine2/efa-utils

Version:

Library for EFA Apps utility functions

17 lines (14 loc) 367 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = toNumber; /** * Function that convert string contains a number to Number. * @param {string} string to convert to number * @returns Number or null */ function toNumber(val) { return val ? isNaN(val) ? val : Number(val) : null; } module.exports = exports.default;