Skip to content

Commit

Permalink
Revert "$.isNumeric -> core/utils/type/isNumeric"
Browse files Browse the repository at this point in the history
This reverts commit 2ac7418.
  • Loading branch information
mpreyskurantov committed Oct 28, 2024
1 parent b904a36 commit 6a30025
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 29 deletions.
47 changes: 23 additions & 24 deletions packages/devextreme/testing/helpers/nativePointerMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
const isString = function(val) { return typeof val === 'string'; };
const isBoolean = function(val) { return typeof val === 'boolean'; };
const isObject = function(val) { return typeof val === 'object'; };
const isNumeric = function(val) { return typeof val === 'number'; };

const MOUSE_EVENTS = {
'click': 1,
Expand Down Expand Up @@ -152,11 +151,11 @@
metaKey = false;
}

if(!isNumeric(keyCode)) {
if(!$.isNumeric(keyCode)) {
keyCode = 0;
}

if(!isNumeric(charCode)) {
if(!$.isNumeric(charCode)) {
charCode = 0;
}

Expand Down Expand Up @@ -223,23 +222,23 @@
view = window;
}

if(!isNumeric(detail)) {
if(!$.isNumeric(detail)) {
detail = 1;
}

if(!isNumeric(screenX)) {
if(!$.isNumeric(screenX)) {
screenX = 0;
}

if(!isNumeric(screenY)) {
if(!$.isNumeric(screenY)) {
screenY = 0;
}

if(!isNumeric(clientX)) {
if(!$.isNumeric(clientX)) {
clientX = 0;
}

if(!isNumeric(clientY)) {
if(!$.isNumeric(clientY)) {
clientY = 0;
}

Expand All @@ -259,7 +258,7 @@
metaKey = false;
}

if(!isNumeric(button)) {
if(!$.isNumeric(button)) {
button = 0;
}

Expand Down Expand Up @@ -326,7 +325,7 @@
if(!isObject(view)) {
view = window;

if(!isNumeric(detail)) {
if(!$.isNumeric(detail)) {
detail = 1;

if($.isFunction(document.createEvent)) {
Expand Down Expand Up @@ -367,18 +366,18 @@
if(!isBoolean(bubbles)) { bubbles = true; }
if(!isBoolean(cancelable)) { cancelable = true; }
if(!isObject(view)) { view = window; }
if(!isNumeric(detail)) { detail = 2; }
if(!isNumeric(screenX)) { screenX = 0; }
if(!isNumeric(screenY)) { screenY = 0; }
if(!isNumeric(clientX)) { clientX = 0; }
if(!isNumeric(clientY)) { clientY = 0; }
if(!$.isNumeric(detail)) { detail = 2; }
if(!$.isNumeric(screenX)) { screenX = 0; }
if(!$.isNumeric(screenY)) { screenY = 0; }
if(!$.isNumeric(clientX)) { clientX = 0; }
if(!$.isNumeric(clientY)) { clientY = 0; }
if(!isBoolean(ctrlKey)) { ctrlKey = false; }
if(!isBoolean(altKey)) { altKey = false; }
if(!isBoolean(shiftKey)) { shiftKey = false; }
if(!isBoolean(metaKey)) { metaKey = false; }

if(!isNumeric(scale)) { scale = 1.0; }
if(!isNumeric(rotation)) { rotation = 0.0; }
if(!$.isNumeric(scale)) { scale = 1.0; }
if(!$.isNumeric(rotation)) { rotation = 0.0; }

const customEvent = document.createEvent('GestureEvent');

Expand Down Expand Up @@ -422,17 +421,17 @@
cancelable = (type !== 'touchcancel');
}
if(!isObject(view)) { view = window; }
if(!isNumeric(detail)) { detail = 1; }
if(!isNumeric(screenX)) { screenX = 0; }
if(!isNumeric(screenY)) { screenY = 0; }
if(!isNumeric(clientX)) { clientX = 0; }
if(!isNumeric(clientY)) { clientY = 0; }
if(!$.isNumeric(detail)) { detail = 1; }
if(!$.isNumeric(screenX)) { screenX = 0; }
if(!$.isNumeric(screenY)) { screenY = 0; }
if(!$.isNumeric(clientX)) { clientX = 0; }
if(!$.isNumeric(clientY)) { clientY = 0; }
if(!isBoolean(ctrlKey)) { ctrlKey = false; }
if(!isBoolean(altKey)) { altKey = false; }
if(!isBoolean(shiftKey)) { shiftKey = false; }
if(!isBoolean(metaKey)) { metaKey = false; }
if(!isNumeric(scale)) { scale = 1.0; }
if(!isNumeric(rotation)) { rotation = 0.0; }
if(!$.isNumeric(scale)) { scale = 1.0; }
if(!$.isNumeric(rotation)) { rotation = 0.0; }

if(UA.android && !UA.chrome) {
customEvent = document.createEvent('MouseEvents');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const $ = require('jquery');
const animationFrame = require('animation/frame');
const coreUtilsType = require('core/utils/type');

QUnit.module('animation frame');

Expand All @@ -9,7 +8,7 @@ QUnit.testInActiveWindow('request', function(assert) {
const animationFrameID = animationFrame.requestAnimationFrame(function() {
done();
});
assert.ok(coreUtilsType.isNumeric(animationFrameID));
assert.ok($.isNumeric(animationFrameID));
});

QUnit.testInActiveWindow('cancel', function(assert) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { setHeight, getHeight } from 'core/utils/size';
import { isNumeric } from 'core/utils/type';
import $ from 'jquery';
import { DEBUG_stub_createIncidentOccurred, DEBUG_restore_createIncidentOccurred } from 'viz/core/base_widget.utils';
import commons from './rangeSelectorParts/commons.js';
Expand Down Expand Up @@ -99,8 +98,8 @@ QUnit.test('check default value valueType when start value is numeric', function
});

const options = this.axis.updateOptions.lastCall.args[0];
assert.ok(isNumeric(options.startValue));
assert.ok(isNumeric(options.endValue));
assert.ok($.isNumeric(options.startValue));
assert.ok($.isNumeric(options.endValue));
assert.strictEqual(options.valueType, 'numeric');
});

Expand Down

0 comments on commit 6a30025

Please sign in to comment.