Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #839: ARIA fixes #3350

Merged
merged 1 commit into from
Sep 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/lib/utils/ObjectUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ export default class ObjectUtils {
* Removes keys from a JSON object that start with a string such as "data" to get all "data-id" type properties.
*
* @param {any} obj the JSON object to reduce
* @param {string} startsWiths the string(s) to check if the property starts with this key
* @param {string[]} startsWiths the string(s) to check if the property starts with this key
* @returns the JSON object containing only the key/values that match the startsWith string
*/
static reduceKeys(obj, ...startsWiths) {
static reduceKeys(obj, startsWiths) {
const result = {};

if (!obj || !startsWiths || !startsWiths.length) {
if (!obj || !startsWiths || startsWiths.length === 0) {
return result;
}

Object.keys(obj)
.filter((key) => startsWiths.some((sw) => key.startsWith(sw)))
.filter((key) => startsWiths.some((value) => key.startsWith(value)))
.forEach(function (key) {
result[key] = obj[key];
delete obj[key];
Expand Down