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

Distance function: multiple arguments #244

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

brontolosone
Copy link
Contributor

Closes #118

One can now call distance() with multiple arguments.

I have verified this PR works in these browsers (latest versions):

  • Chromium
  • Firefox

What else has been done to verify that this works as intended?

  • Ran yarn test-node:jsdom xforms in the packages/xpath directory.

Why is this the best possible solution? Were any other approaches considered?

It might not be; the argument count error handling is not ideal. When I create a form that calls distance() (so 0 arguments) an error is thrown (good) but the message is "Argument 1 not allowed" which is rather odd. But I've been told the errors are going to get reworked, some rethinking is slated to happen in #202.

Do we need any specific form for testing your changes? If so, please attach one.

The below is handy. Didn't work before, but now it does.
distance.xlsx

Copy link

changeset-bot bot commented Oct 25, 2024

🦋 Changeset detected

Latest commit: 8022781

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@getodk/xpath Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brontolosone brontolosone added this to the Next milestone Oct 25, 2024
@brontolosone brontolosone force-pushed the 118_variadic_distance_function branch from 70ba459 to 37e5528 Compare October 25, 2024 21:24
@brontolosone brontolosone marked this pull request as draft October 29, 2024 14:38
@brontolosone brontolosone marked this pull request as ready for review December 17, 2024 14:25
@brontolosone brontolosone marked this pull request as draft December 17, 2024 17:13
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

Successfully merging this pull request may close these issues.

Add multiple-argument distance variant
2 participants