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

Allow smart merging via expansion #8

Merged
merged 1 commit into from
May 27, 2023
Merged

Allow smart merging via expansion #8

merged 1 commit into from
May 27, 2023

Conversation

sayanarijit
Copy link
Owner

@sayanarijit sayanarijit commented May 27, 2023

To allow merging arrays and objects via expansion, trailing comma after s and q will be auto removed after the expansion if no value is passed for the placeholder.

Example:

jf "[%(a)*s, %(b)*s]" b=2 b=1
# [2,1]

jf "{%(a)**s, %(b)**s}" b=2 b=1
# {"2":1}

To allow merging arrays and objects via expansion, trailing commas after `s`
and `q` will be auto removed after the expansion if no value is passed for the
placeholder.

Example:

```bash
jf "[%(a)*s, %(b)*s]" b=2 b=1

jf "{%(a)**s, %(b)**s}" b=2 b=1
```
@sayanarijit sayanarijit merged commit 6e85ea9 into main May 27, 2023
@sayanarijit sayanarijit deleted the smart-merging branch May 27, 2023 11:53
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.

1 participant