From 710613a43a33a05a79fc386cf705b4bc9b395242 Mon Sep 17 00:00:00 2001 From: melloware Date: Wed, 21 Sep 2022 11:35:23 -0400 Subject: [PATCH] Fix #839: ARIA fixes --- components/lib/utils/ObjectUtils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/lib/utils/ObjectUtils.js b/components/lib/utils/ObjectUtils.js index 9d15745235..4ba0250bbe 100644 --- a/components/lib/utils/ObjectUtils.js +++ b/components/lib/utils/ObjectUtils.js @@ -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];