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

Pipeline of string keywords appears to skip intermediate options #1144

Open
fnimick opened this issue Sep 21, 2024 · 1 comment
Open

Pipeline of string keywords appears to skip intermediate options #1144

fnimick opened this issue Sep 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@fnimick
Copy link

fnimick commented Sep 21, 2024

Report a bug

🔎 Search Terms

string, keywords, string.lower, string.trim, case

🧩 Context

OS: macOS 15.0
CPU: (10) arm64 Apple M1 Pro
Memory: 92.36 MB / 16.00 GB
Shell: 5.9 - /bin/zsh

Binaries:
Node: 20.13.1 - ~/.asdf/installs/nodejs/20.13.1/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 10.5.2 - ~/.asdf/plugins/nodejs/shims/npm
pnpm: 9.7.0 - ~/.asdf/shims/pnpm
npmPackages:
arktype: ^2.0.0-rc.12 => 2.0.0-rc.12
typescript: ^5.5.4 => 5.5.4

🧑‍💻 Repro

type('string.lower').to('string.trim').to("'success'")('Success')
type('string.lower').to('string.trim').to("'success'")('success ')
type('string.trim').to('string.lower').to("'success'")('Success')
type('string.trim').to('string.lower').to("'success'")('success ')

It appears that the intermediate type does not take effect.

@fnimick fnimick added the bug Something isn't working label Sep 21, 2024
@fnimick
Copy link
Author

fnimick commented Sep 21, 2024

It also seems to happen with pipe:

type('string.trim').pipe(type('string.lower'), type('string'))('Foo ')

I expect this to return 'foo', but it errors instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: To do
Development

No branches or pull requests

2 participants