mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47:56 +01:00
Fix number validation
This commit is contained in:
parent
86780ed0e9
commit
33967db04b
@ -26,7 +26,7 @@ class Font {
|
|||||||
|
|
||||||
init(args) {
|
init(args) {
|
||||||
if ($defined(args.size)) {
|
if ($defined(args.size)) {
|
||||||
this._size = parseInt(args.size, 10);
|
this._size = Number.parseInt(args.size, 10);
|
||||||
}
|
}
|
||||||
if ($defined(args.style)) {
|
if ($defined(args.style)) {
|
||||||
this._style = args.style;
|
this._style = args.style;
|
||||||
@ -69,8 +69,8 @@ class Font {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setSize(value) {
|
setSize(value) {
|
||||||
const size = parseInt(value, 10);
|
const size = Number.parseInt(value, 10);
|
||||||
$assert(!Number.isNaN(size), 'size must be a valid integer');
|
$assert(!Number.isFinite(size), 'size must be a valid integer');
|
||||||
this._size = size;
|
this._size = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user