Skip to content

Fix typos (#670)#680

Closed
Vrajcoding wants to merge 1 commit intochalk:mainfrom
Vrajcoding:optimize/createBuilder-2arg-fastpath
Closed

Fix typos (#670)#680
Vrajcoding wants to merge 1 commit intochalk:mainfrom
Vrajcoding:optimize/createBuilder-2arg-fastpath

Conversation

@Vrajcoding
Copy link
Copy Markdown

Hi @mdhamed238

I’ve implemented a behavior-safe optimization for the createBuilder function, specifically targeting the common 2-argument case.

This version avoids Array.join overhead while preserving its coercion semantics:

  • null / undefined → empty string (using == null)
  • other values → String(value) (matching toString() behavior)

I’ve kept the change minimal and fallback to the existing .join(' ') logic for all other cases.

Would really appreciate your feedback on this approach. Thanks!

@chalk chalk locked as spam and limited conversation to collaborators Mar 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants