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

isArray behavior on missing/empty tags #619

Open
faljse opened this issue Oct 18, 2023 · 1 comment
Open

isArray behavior on missing/empty tags #619

faljse opened this issue Oct 18, 2023 · 1 comment

Comments

@faljse
Copy link

faljse commented Oct 18, 2023

"isArray" is true for References.Reference
"alwaysCreateTextNode" is true

case 1:

  <UAReferenceType>
    <References>
      <Reference></Reference>
    </References>
  </UAReferenceType>

UAReferenceType.['References'] is an array

case 2:

  <UAReferenceType>
  </UAReferenceType>

UAReferenceType.['References'] is now undefined; evals to false

case 3:

  <UAReferenceType>
     <References />
  </UAReferenceType>

UAReferenceType.['References'] now contains an object with ['#text']; evals to true

isarray saves me from a lot of extra checks; still it seems like this could be improved?

@github-actions
Copy link

We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@faljse and others