mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-05-14 09:33:32 +00:00
fix(js): use Object.prototype.hasOwnProperty.call in day-selector widget
Direct .hasOwnProperty() calls on objects can be shadowed if the object itself has a property named hasOwnProperty. Using Object.prototype. hasOwnProperty.call(obj, key) is the safe, ESLint-compliant form. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -91,7 +91,7 @@
|
|||||||
const xOptions = config['x-options'] || config['x_options'] || {};
|
const xOptions = config['x-options'] || config['x_options'] || {};
|
||||||
const requestedFormat = xOptions.format || 'long';
|
const requestedFormat = xOptions.format || 'long';
|
||||||
// Validate format exists in DAY_LABELS, default to 'long' if not
|
// Validate format exists in DAY_LABELS, default to 'long' if not
|
||||||
const format = DAY_LABELS.hasOwnProperty(requestedFormat) ? requestedFormat : 'long';
|
const format = Object.prototype.hasOwnProperty.call(DAY_LABELS, requestedFormat) ? requestedFormat : 'long';
|
||||||
const layout = xOptions.layout || 'horizontal';
|
const layout = xOptions.layout || 'horizontal';
|
||||||
const showSelectAll = xOptions.selectAll !== false;
|
const showSelectAll = xOptions.selectAll !== false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user