Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"gl-mat4": "^1.2.0",
"gl-vec3": "^1.1.3",
"gl-vec4": "^1.0.1",
"jquery": "^3.6.0",
"jquery": "^4.0.0",
"kdbush": "^4.0.0",
"mousetrap": "^1.6.5",
"proj4": "^2.7.5"
Expand Down
2 changes: 1 addition & 1 deletion src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ var map = function (arg) {
throw new Error('Map require DIV node');
}

if (m_node.data('data-geojs-map') && $.isFunction(m_node.data('data-geojs-map').exit)) {
if (m_node.data('data-geojs-map') && typeof m_node.data('data-geojs-map').exit === 'function') {
m_node.data('data-geojs-map').exit();
}
m_node.addClass('geojs-map');
Expand Down
8 changes: 4 additions & 4 deletions src/tileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ var tileLayer = function (arg) {
// (math.ceil(min(w, h) / (ts*2**l)) + 1) for l in range(ml)])
arg.cacheSize = arg.keepLower ? 600 : 200;
}
if ($.type(arg.subdomains) === 'string') {
if (typeof arg.subdomains === 'string') {
arg.subdomains = arg.subdomains.split('');
}
/* We used to call the url option baseUrl. If a baseUrl is specified, use
Expand All @@ -219,7 +219,7 @@ var tileLayer = function (arg) {
}
/* Save the original url so that we can return it if asked */
arg.originalUrl = arg.url;
if ($.type(arg.url) === 'string') {
if (typeof arg.url === 'string') {
arg.url = m_tileUrlFromTemplate(arg.url);
}

Expand Down Expand Up @@ -1636,7 +1636,7 @@ var tileLayer = function (arg) {
return m_this;
}
m_this._options.originalUrl = url;
if ($.type(url) === 'string') {
if (typeof url === 'string') {
url = m_tileUrlFromTemplate(url);
}
m_this._options.url = url;
Expand All @@ -1657,7 +1657,7 @@ var tileLayer = function (arg) {
return m_this._options.subdomains;
}
if (subdomains) {
if ($.type(subdomains) === 'string') {
if (typeof subdomains === 'string') {
if (subdomains.indexOf(',') >= 0) {
subdomains = subdomains.split(',');
} else {
Expand Down
21 changes: 16 additions & 5 deletions src/util/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@ var util = {
var action, i;
for (i = 0; i < actions.length; i += 1) {
action = actions[i];
if ($.type(action.input) === 'string') {
if (typeof action.input === 'string') {
var actionEvents = {};
actionEvents[action.input] = true;
action.input = actionEvents;
}
if (!action.modifiers) {
action.modifiers = {};
}
if ($.type(action.modifiers) === 'string') {
if (typeof action.modifiers === 'string') {
var actionModifiers = {};
actionModifiers[action.modifiers] = true;
action.modifiers = actionModifiers;
Expand Down Expand Up @@ -912,6 +912,17 @@ var util = {
return leftSide.slice(0, leftSide.length - 1).concat(rightSide);
},

/**
* Replicate jQuery 3's isNumeric function.
*
* @param {*} n Value to test
* @returns {boolean} True if the value is a finite number or a numeric
* string.
*/
isNumeric: function (n) {
return (typeof n === 'number' || typeof n === 'string') && !isNaN(n - parseFloat(n));
},

/**
* Given an array, return the minimum and maximum values within the array.
* If a numeric value is specified for one or the other, return that instead.
Expand All @@ -930,7 +941,7 @@ var util = {
* @memberof geo.util
*/
getMinMaxValues: function (values, min, max, limit) {
if (values.length && (limit || !$.isNumeric(min) || !$.isNumeric(max))) {
if (values.length && (limit || !util.isNumeric(min) || !util.isNumeric(max))) {
var minValue = values[0],
maxValue = values[0],
value, i;
Expand All @@ -939,10 +950,10 @@ var util = {
if (value < minValue) { minValue = value; }
if (value > maxValue) { maxValue = value; }
}
if (!$.isNumeric(min) || (limit && minValue > min)) {
if (!util.isNumeric(min) || (limit && minValue > min)) {
min = minValue;
}
if (!$.isNumeric(max) || (limit && maxValue < max)) {
if (!util.isNumeric(max) || (limit && maxValue < max)) {
max = maxValue;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/headed-cases/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('examples', function () {
} catch (err) { }
if (idle) {
exampleWindow.clearInterval(interval);
if (!ex$.isFunction(idle)) {
if (typeof idle !== 'function') {
idle = idle.then || idle.done;
}
idle(function () {
Expand Down
2 changes: 1 addition & 1 deletion tests/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ module.exports.getQuery = function () {
* It should be done if the webgl renderer was mocked before it is restored.
*/
function destroyMap() {
if ($('#map').data('data-geojs-map') && $.isFunction($('#map').data('data-geojs-map').exit)) {
if ($('#map').data('data-geojs-map') && typeof $('#map').data('data-geojs-map').exit === 'function') {
$('#map').data('data-geojs-map').exit();
}
$('#map').remove();
Expand Down
2 changes: 1 addition & 1 deletion tests/tutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('tutorials', function () {
var defer = tut$.Deferred();
deferreds.push(defer);
var idle = targetWindow.eval(idleFunc);
if (!tut$.isFunction(idle)) {
if (typeof idle !== 'function') {
idle = idle.then || idle.done;
}
idle(function () {
Expand Down
2 changes: 1 addition & 1 deletion webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module.exports = {
},
resolve: {
alias: {
jquery: 'jquery/dist/jquery',
proj4: 'proj4/lib',
hammerjs: '@egjs/hammerjs/dist/hammer.js',
mousetrap: 'mousetrap/mousetrap.js'
Expand All @@ -58,6 +57,7 @@ module.exports = {
/node_modules\/@velipso\/polybool/,
/node_modules\/color-name/,
/node_modules\/earcut/,
/node_modules\/jquery/,
/node_modules\/kdbush/,
/node_modules\/proj4/,
/node_modules\/wkt-parser/
Expand Down