Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
20 lines
732 B
JavaScript
20 lines
732 B
JavaScript
'use strict';
|
|
var sign = require('../internals/math-sign');
|
|
var roundTiesToEven = require('../internals/math-round-ties-to-even');
|
|
|
|
var abs = Math.abs;
|
|
|
|
var EPSILON = 2.220446049250313e-16; // Number.EPSILON
|
|
|
|
module.exports = function (x, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) {
|
|
var n = +x;
|
|
var absolute = abs(n);
|
|
var s = sign(n);
|
|
if (absolute < FLOAT_MIN_VALUE) return s * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON;
|
|
var a = (1 + FLOAT_EPSILON / EPSILON) * absolute;
|
|
var result = a - (a - absolute);
|
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
if (result > FLOAT_MAX_VALUE || result !== result) return s * Infinity;
|
|
return s * result;
|
|
};
|