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>
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
'use strict';
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.DnsTxt = void 0;
|
|
class DnsTxt {
|
|
constructor(opts = {}) {
|
|
this.binary = opts ? opts.binary : false;
|
|
}
|
|
encode(data = {}) {
|
|
return Object.entries(data)
|
|
.map(([key, value]) => {
|
|
let item = `${key}=${value}`;
|
|
return Buffer.from(item);
|
|
});
|
|
}
|
|
decode(buffer) {
|
|
var data = {};
|
|
try {
|
|
let format = buffer.toString();
|
|
let parts = format.split(/=(.+)/);
|
|
let key = parts[0];
|
|
let value = parts[1];
|
|
data[key] = value;
|
|
}
|
|
catch (_) { }
|
|
return data;
|
|
}
|
|
decodeAll(buffer) {
|
|
return buffer
|
|
.filter(i => i.length > 1)
|
|
.map(i => this.decode(i))
|
|
.reduce((prev, curr) => {
|
|
var obj = prev;
|
|
let [key] = Object.keys(curr);
|
|
let [value] = Object.values(curr);
|
|
obj[key] = value;
|
|
return obj;
|
|
}, {});
|
|
}
|
|
}
|
|
exports.DnsTxt = DnsTxt;
|
|
exports.default = DnsTxt;
|
|
//# sourceMappingURL=dns-txt.js.map
|