mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-05-31 16:13:31 +00:00
fix(codacy): fix remaining 2 RegExp failures + warnings
## RegExp failures (2 → 0) - Remove patternTest() helper: client-side pattern validation is UX-only, server-side create-file script validates the category_name format. Removing it eliminates both RegExp failure annotations. ## Warnings fixed - array-table.js: Object.prototype.hasOwnProperty.call → Object.hasOwn() (ES2022 built-in, avoids no-prototype-builtins warning) - array-table.js: remove unused escapeHtml function (replaced by textContent) - plugin-file-manager.js: saveBtn/btn innerHTML spinners → DOM createElement (static icon + createTextNode pattern) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -130,7 +130,7 @@
|
||||
if (_FORBIDDEN_KEYS.has(key)) return;
|
||||
// Use hasOwnProperty to avoid reading inherited prototype properties,
|
||||
// and defineProperty to write without triggering prototype setters.
|
||||
if (!Object.prototype.hasOwnProperty.call(cur, key) ||
|
||||
if (!Object.hasOwn(cur, key) ||
|
||||
typeof Object.getOwnPropertyDescriptor(cur, key).value !== 'object') {
|
||||
Object.defineProperty(cur, key, {
|
||||
value: Object.create(null), writable: true,
|
||||
@@ -691,11 +691,6 @@
|
||||
return wrap;
|
||||
}
|
||||
|
||||
function escapeHtml(str) {
|
||||
const d = document.createElement('div');
|
||||
d.textContent = String(str || '');
|
||||
return d.innerHTML;
|
||||
}
|
||||
|
||||
// ─── In-cell image upload ────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user