-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add $nth operator to questDk #71
Conversation
🦋 Changeset detectedLatest commit: 063813c The changes in this PR will be included in the next version bump. 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 |
Forgot to add type here Line 3 in 8b36b8a
Will add this asap |
@@ -10,6 +10,12 @@ export type ArrayOperator = | |||
| { | |||
$last?: FilterOperator | |||
} | |||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks right I just cleaned it up into it's own type
It's set manually for each build command we don't need a default value
Size Change: +198 B (+1%) Total Size: 23.5 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - I fixed the build and tweaked the types a little but this is good to go once you look over my changes.
@@ -10,6 +10,12 @@ export type ArrayOperator = | |||
| { | |||
$last?: FilterOperator | |||
} | |||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks right I just cleaned it up into it's own type
This PR adds a $nth array operator which can be used to target specific items inside an array of parameters. It complements the $first, $last, and $some operators.
Tests were added to ensure the correct functionality of the $nth operator under various scenarios. These include validating that the operator correctly identifies the nth item in an array and that it will correctly handle when n exceeds the array length.