Skip to content

Commit

Permalink
fixes #2881
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonasdan committed Dec 19, 2023
1 parent 46171e3 commit 143e33a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/js/utilities/optionConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,7 @@ export class OptionConverter {
if (eData?.tdTargetInput) delete eData.tdTargetInput;
if (eData?.tdTargetToggle) delete eData.tdTargetToggle;

if (
!eData ||
Object.keys(eData).length === 0 ||
eData.constructor !== DOMStringMap
)
return options;
if (!eData || Object.keys(eData).length === 0) return options;
const dataOptions = {} as Options;

// because dataset returns camelCase including the 'td' key the option
Expand Down Expand Up @@ -253,7 +248,7 @@ export class OptionConverter {
if (keyOption === undefined) return internalObject;

// if this is another object, continue down the rabbit hole
if (optionSubgroup[keyOption].constructor === Object) {
if (optionSubgroup[keyOption]?.constructor === Object) {
index++;
internalObject[keyOption] = normalizeObject(
split,
Expand Down

0 comments on commit 143e33a

Please sign in to comment.