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

Proposal: add stringSplit #52

Open
tychenjiajun opened this issue Jul 19, 2022 · 1 comment
Open

Proposal: add stringSplit #52

tychenjiajun opened this issue Jul 19, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tychenjiajun
Copy link
Contributor

It's already in the example in https://github.com/sindresorhus/type-fest/blob/main/source/split.d.ts

Real-world usage:
See https://floating-ui.com/docs/tutorial#arrow-middleware

const staticSide = {
    top: 'bottom',
    right: 'left',
    bottom: 'top',
    left: 'right',
}[placement.split('-')[0]]; // ts-error
@sindresorhus
Copy link
Owner

👍

@sindresorhus sindresorhus added enhancement New feature or request help wanted Extra attention is needed labels Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants