Skip to content

Conversation

@miorel
Copy link
Contributor

@miorel miorel commented Sep 28, 2024

No description provided.

export function only<T>(array: readonly T[]): T {
invariant(array.length === 1, "Expected a single element array!");
return array[0];
export function only<T>(iterable: Iterable<T>): T {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up not using the changes to this function, but this seems like a generally useful improvement.

Copy link
Contributor

@elimanzo elimanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@miorel miorel merged commit b48a688 into main Sep 29, 2024
7 checks passed
@miorel miorel deleted the webpack-chmod branch September 29, 2024 01:50
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.

3 participants