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:
Chuck
2026-05-30 22:23:58 -04:00
parent e00b124b8f
commit 6cdafe7b29
2 changed files with 6 additions and 31 deletions

View File

@@ -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 ────────────────────────────────────────────────