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>
32 lines
1.2 KiB
JavaScript
32 lines
1.2 KiB
JavaScript
'use strict';
|
|
var uncurryThis = require('../internals/function-uncurry-this');
|
|
var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
var toString = require('../internals/to-string');
|
|
var whitespaces = require('../internals/whitespaces');
|
|
|
|
var replace = uncurryThis(''.replace);
|
|
var ltrim = RegExp('^[' + whitespaces + ']+');
|
|
var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
|
|
|
|
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
var createMethod = function (TYPE) {
|
|
return function ($this) {
|
|
var string = toString(requireObjectCoercible($this));
|
|
if (TYPE & 1) string = replace(string, ltrim, '');
|
|
if (TYPE & 2) string = replace(string, rtrim, '$1');
|
|
return string;
|
|
};
|
|
};
|
|
|
|
module.exports = {
|
|
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
start: createMethod(1),
|
|
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
end: createMethod(2),
|
|
// `String.prototype.trim` method
|
|
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
trim: createMethod(3)
|
|
};
|