From da912987cfad88007ad90df304dce5b553a55355 Mon Sep 17 00:00:00 2001 From: cy_altern Date: Sat, 14 May 2022 16:54:55 +0200 Subject: [PATCH] =?UTF-8?q?patch=20pour=20le=20bogue=20de=20toLowercase()?= =?UTF-8?q?=20appliqu=C3=A9=20sur=20un=20integer=20:=20on=20am=C3=A9liore?= =?UTF-8?q?=20la=20d=C3=A9tection=20des=20nombre=20en=20acceptant=20les=20?= =?UTF-8?q?string=20qui=20sont=20des=20nombre=20+=20on=20passe=20toString(?= =?UTF-8?q?)=20avant=20toLowercase=20pour=20ne=20pas=20planter=20quoi=20qu?= =?UTF-8?q?'on=20envoie=20comme=20type=20de=20valeur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/gamutable.es6.js | 8 ++++---- js/gamutable.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/js/gamutable.es6.js b/js/gamutable.es6.js index 6ab70ea..bc334fb 100644 --- a/js/gamutable.es6.js +++ b/js/gamutable.es6.js @@ -709,11 +709,11 @@ let monTableau = { this.quelleVue = vue; }, ordonnerSelect(a, b) { - if (Number.isInteger(a) && Number.isInteger(b)) { - return a - b; + if ((Number.isInteger(a) || parseInt(a) == a) && (Number.isInteger(b) || parseInt(b) == b)) { + return parseInt(a) - parseInt(b); } else { - let x = a.toLowerCase(); - let y = b.toLowerCase(); + let x = toString(a).toLowerCase(); + let y = toString(b).toLowerCase(); if (x < y) { return -1; } diff --git a/js/gamutable.js b/js/gamutable.js index 761fbdb..488344f 100644 --- a/js/gamutable.js +++ b/js/gamutable.js @@ -20,7 +20,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } jQuery(function () { $('#app').on('click', '.url_action', function (e) { @@ -822,11 +822,11 @@ var monTableau = { this.quelleVue = vue; }, ordonnerSelect: function ordonnerSelect(a, b) { - if (Number.isInteger(a) && Number.isInteger(b)) { - return a - b; + if ((Number.isInteger(a) || parseInt(a) == a) && (Number.isInteger(b) || parseInt(b) == b)) { + return parseInt(a) - parseInt(b); } else { - var x = a.toLowerCase(); - var y = b.toLowerCase(); + var x = toString(a).toLowerCase(); + var y = toString(b).toLowerCase(); if (x < y) { return -1;