UNPKG

581 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = isNumeric;
7
8var _assertString = _interopRequireDefault(require("./util/assertString"));
9
10function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12var numeric = /^[+-]?([0-9]*[.])?[0-9]+$/;
13var numericNoSymbols = /^[0-9]+$/;
14
15function isNumeric(str, options) {
16 (0, _assertString.default)(str);
17
18 if (options && options.no_symbols) {
19 return numericNoSymbols.test(str);
20 }
21
22 return numeric.test(str);
23}
24
25module.exports = exports.default;
\No newline at end of file