jodit
Version:
Jodit is an awesome and useful wysiwyg editor with filebrowser
22 lines (21 loc) • 627 B
JavaScript
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module helpers/checker
*/
import { isString } from "./is-string.js";
/**
* Check value has numeric format
*/
export function isNumeric(value) {
if (isString(value)) {
if (!value.match(/^([+-])?[0-9]+(\.?)([0-9]+)?(e[0-9]+)?$/)) {
return false;
}
value = parseFloat(value);
}
return typeof value === 'number' && !isNaN(value) && isFinite(value);
}