Files
formipay/node_modules/es-abstract/2023/IsLooselyEqual.js
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
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>
2026-04-18 17:02:14 +07:00

59 lines
1.8 KiB
JavaScript

'use strict';
var isFinite = require('math-intrinsics/isFinite');
var isObject = require('es-object-atoms/isObject');
var IsStrictlyEqual = require('./IsStrictlyEqual');
var StringToBigInt = require('./StringToBigInt');
var ToNumber = require('./ToNumber');
var ToPrimitive = require('./ToPrimitive');
var isSameType = require('../helpers/isSameType');
// https://262.ecma-international.org/13.0/#sec-islooselyequal
module.exports = function IsLooselyEqual(x, y) {
if (isSameType(x, y)) {
return IsStrictlyEqual(x, y);
}
if (x == null && y == null) {
return true;
}
if (typeof x === 'number' && typeof y === 'string') {
return IsLooselyEqual(x, ToNumber(y));
}
if (typeof x === 'string' && typeof y === 'number') {
return IsLooselyEqual(ToNumber(x), y);
}
if (typeof x === 'bigint' && typeof y === 'string') {
var n = StringToBigInt(y);
if (typeof n === 'undefined') {
return false;
}
return IsLooselyEqual(x, n);
}
if (typeof x === 'string' && typeof y === 'bigint') {
return IsLooselyEqual(y, x);
}
if (typeof x === 'boolean') {
return IsLooselyEqual(ToNumber(x), y);
}
if (typeof y === 'boolean') {
return IsLooselyEqual(x, ToNumber(y));
}
if ((typeof x === 'string' || typeof x === 'number' || typeof x === 'symbol' || typeof x === 'bigint') && isObject(y)) {
return IsLooselyEqual(x, ToPrimitive(y));
}
if (isObject(x) && (typeof y === 'string' || typeof y === 'number' || typeof y === 'symbol' || typeof y === 'bigint')) {
return IsLooselyEqual(ToPrimitive(x), y);
}
if ((typeof x === 'bigint' && typeof y === 'number') || (typeof x === 'number' && typeof y === 'bigint')) {
if (!isFinite(x) || !isFinite(y)) {
return false;
}
// eslint-disable-next-line eqeqeq
return x == y; // shortcut for step 13.b.
}
return false;
};