Support 2D array inputs for WIKIDATAQID.#43
Conversation
|
This looks like it works already. Maybe an alternative to having a no-array variant for each function could be the following pattern: function(input) {
if (!Array.isArray(input) {
input = [input];
}
/*…*/
}So the function would assume an array by default, and if it's passed a non-array would convert it on the fly. I'm not 100% sure if this would be feasible if there are other arguments. |
|
Thanks for the review Thomas! From your recommendation snippet, I'm assuming the The problem is all the existing code assumes non-array, and so all existing code would need to be wrapped in a for loop in a for loop, with an outer 2D array to capture results. It's a bit clunky? Another alternative is to wrap your existing code with a function that's defined inside the outer function. Example: This saves the definition of an awkwardly-named function. If your concern is the awkwardly-named function WIKIDATAQID_NOTARRAY_, then I think this idea is the right approach. Let me know your thoughts. Thanks! |
|
Then I think going with the nested |
|
Updates to my PR:
|
|
It looks like this is good to go. Do you prefer to open PRs for each function, or have one large PR (my preference). |
This is related to #41
This is the first PR for broad support for your Wikipedia functions to support array inputs.
=WIKIDATAQID(A6:A10).The goal of this PR is to establish a baseline for how we'd like each function to be updated, and then update many more.
FYI, this is my first ever pull request :)