mirror of
https://gitee.com/bimuziyan/ccc-obfuscated-code.git
synced 2026-05-20 06:56:13 +08:00
12 lines
310 B
JavaScript
12 lines
310 B
JavaScript
import assertString from './util/assertString';
|
|
var numeric = /^[+-]?([0-9]*[.])?[0-9]+$/;
|
|
var numericNoSymbols = /^[0-9]+$/;
|
|
export default function isNumeric(str, options) {
|
|
assertString(str);
|
|
|
|
if (options && options.no_symbols) {
|
|
return numericNoSymbols.test(str);
|
|
}
|
|
|
|
return numeric.test(str);
|
|
} |