-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add support for array of inputs #9
Add support for array of inputs #9
Conversation
### file-icon Swift executable - first and third CLI arguments are treated as comma-separated arrays - if multiple apps are passed as the first CLI argument and the output is written to STDOUT, files are separated by `<EOF>` ### file-icon NodeJS library - Convert all single value inputs into arrays and treat all `file` arguments as an array - fileIcon.buffer returns a `Promise<Buffer>` if `file` is a single value, but will return a `<Promise<Array<Buffer>>` if `file` is an array - Add stricter argument validation with tests - Add tests for all possible use cases and value types with new API - Update ava package to 2.4.0
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.
From my understanding, the PR looks good!
Just one minor thing.
@sindresorhus Thanks for the thorough review! I've been pretty busy these last few days, will try to address / reply to all comments between tomorrow and wednesday. |
- Change all instances of id to ID, pid to PID in test names - Test buffer array lengths - Remove anonymous function usage in `t.throwsAsync` and `t.notThrowsAsync` - Send a single JSON string as CLI argument - Remove PID detection from JS, check in Swift instead (simplify CLI input)
@sindresorhus Updated with requested changes |
- Don't force unwrap, use `if let` instead - Rename input.application to input.appOrPID - Don't use one character variable names - Change `Array<string>` to `string[]` in readme.md
@sindresorhus updated! |
@sindresorhus Missed that comment. Unfortunately I've been pretty busy and had no real time to dedicate to this issue. I will take a better look, and am planning to pick this up again this weekend. Thank you and sorry for the delay! |
- Use multiple concurrent calls to Swift binary in `buffer` mode - Add pMap as a dependency
Is this ready? |
If it's ok with you, I would consider this ready, yes :) |
Looks great! Thanks for persevering through this. It ended up really well. |
Awesome, glad I could help! 😄 |
Fixes #2
file-icon Swift executable
<EOF>
file-icon NodeJS library
file
arguments as an arrayPromise<Buffer>
iffile
is a single value, but will return a<Promise<Array<Buffer>>
iffile
is an arrayIssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor