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>
30 lines
698 B
JavaScript
30 lines
698 B
JavaScript
'use strict';
|
|
|
|
var callBound = require('call-bound');
|
|
|
|
var $numToStr = callBound('Number.prototype.toString');
|
|
|
|
/** @type {import('.')} */
|
|
var tryNumberObject = function tryNumberObject(value) {
|
|
try {
|
|
$numToStr(value);
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
};
|
|
var $toString = callBound('Object.prototype.toString');
|
|
var numClass = '[object Number]';
|
|
var hasToStringTag = require('has-tostringtag/shams')();
|
|
|
|
/** @type {import('.')} */
|
|
module.exports = function isNumberObject(value) {
|
|
if (typeof value === 'number') {
|
|
return true;
|
|
}
|
|
if (!value || typeof value !== 'object') {
|
|
return false;
|
|
}
|
|
return hasToStringTag ? tryNumberObject(value) : $toString(value) === numClass;
|
|
};
|