https://github.com/kutyel/pipeline-experiments
Experiments with the new pipeline operator 🤓
https://github.com/kutyel/pipeline-experiments
babel babel-experiments babel-proposal javascript pipeline-operator
Last synced: about 1 year ago
JSON representation
Experiments with the new pipeline operator 🤓
- Host: GitHub
- URL: https://github.com/kutyel/pipeline-experiments
- Owner: kutyel
- License: mit
- Created: 2018-03-13T07:30:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-17T15:14:03.000Z (over 7 years ago)
- Last Synced: 2025-02-23T17:37:24.754Z (over 1 year ago)
- Topics: babel, babel-experiments, babel-proposal, javascript, pipeline-operator
- Language: JavaScript
- Homepage:
- Size: 65.4 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pipeline-experiments
Experiments with the new pipeline operator 🤓
```js
const camelCase = str =>
str
|> match(/[A-Za-z]+/g)
|> map(toLower)
|> over(lensIndex(1), replace(/^./g, toUpper))
|> join('')
const test = [
'foo-bar',
'foo_bar',
'Foo-Bar',
'--foo.bar',
'__foo__bar__',
'foo bar'
]
test |> map(camelCase) |> all(equals('fooBar')) |> console.log // true!!!
```