pelias / pelias/spatial

allow `queryLayers` to be array-like

Open
#128 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
32
Forks
8
Avg merge
13m
Merged PRs (30d)
1

Description

This line should be rewritten in such a way that it accepts any input which is 'array-like' (ie. can be destructured with the spread operator) such that either an array or a set may be passed in.

I believe the only thing currently preventing that is the check for .size

https://github.com/pelias/spatial/blob/dec83175963fc8b632cfd97051f3f15fcbf7f975/server/routes/pip_pelias.js#L63

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open server/routes/pip_pelias.js at line 63, as linked in the issue, and inspect how queryLayers is checked before being used. Verify the change accepts both an array and a set, while preserving the existing behavior for array-like inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.