Skip to content

Fix unnamed placeholders extraction#25

Merged
aduth merged 2 commits intoaduth:masterfrom
sdnunca:fix/sprintf-types-placeholder-count
Aug 30, 2025
Merged

Fix unnamed placeholders extraction#25
aduth merged 2 commits intoaduth:masterfrom
sdnunca:fix/sprintf-types-placeholder-count

Conversation

@sdnunca
Copy link
Contributor

@sdnunca sdnunca commented Aug 26, 2025

The unnamed placeholder logic skips positional placeholders, which it determines as:
% followed by anything followed by $.

This causes strings such as:

Test %s with $ after

to be interpreted as having a %s with $ positional placeholder, returning [].

This PR makes the logic to determine positional placeholders more specific:
% followed by a number followed by $.

@aduth
Copy link
Owner

aduth commented Aug 28, 2025

Thanks for the patch! This change makes sense to me, though I'd be curious for @USERSATOSHI's feedback as well, since he authored the typings.

@USERSATOSHI
Copy link
Contributor

Oh, nice catch. I have tested the patch and it works great. So Looks good to me.

cc: @sdnunca @aduth

Copy link
Owner

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Thanks @USERSATOSHI for the review, and thanks again @sdnunca for the fix. I'll get this published shortly.

@aduth aduth merged commit 69d36e3 into aduth:master Aug 30, 2025
3 checks passed
@aduth
Copy link
Owner

aduth commented Aug 30, 2025

This is now published in @tannin/[email protected] 🚀

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