Skip to content

feat: enable stringLiterals for pipe() API#900

Merged
antonmedv merged 1 commit into
google:mainfrom
antongolub:pipe-literal
Sep 17, 2024
Merged

feat: enable stringLiterals for pipe() API#900
antonmedv merged 1 commit into
google:mainfrom
antongolub:pipe-literal

Conversation

@antongolub

@antongolub antongolub commented Sep 17, 2024

Copy link
Copy Markdown
Collaborator

Enables zurk-like pipe literals:

const p = await $`echo foo`.pipe`cat`
assert.equal(p.stdout.trim(), 'foo')
  • Tests pass

@antonmedv

Copy link
Copy Markdown
Collaborator

I'm not sure about the API. I think with explicit $ is clearer.

const p = await $`echo foo`.pipe($`cat`)
assert.equal(p.stdout.trim(), 'foo')

What we can do is also prepare for the future |> pipe syntax.

const p = 
  await $`echo foo`
  |> $`cat`
assert.equal(p.stdout.trim(), 'foo')

@antongolub

Copy link
Copy Markdown
Collaborator Author

Ok

@antongolub antongolub closed this Sep 17, 2024
@antongolub antongolub reopened this Sep 17, 2024
@antonmedv antonmedv merged commit 5038ec5 into google:main Sep 17, 2024
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.

2 participants