Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@bitty/pipe
Advanced tools
A pipe function to perform function composition in LTR (Left To Right) direction.
@bitty/pipe
A pipe function to perform function composition in LTR (Left-To-Right) direction.
📦 Distributions in ESM, CommonJS, UMD and UMD minified formats.
⚡ Lightweight:
ramda.pipe
.🔋 Bateries included:
🏷 Safe:
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install @bitty/pipe --save
# For Yarn, use the command below.
yarn add @bitty/pipe
This module has a UMD bundle available through JSDelivr and Unpkg CDNs.
<!-- For UNPKG use the code below. -->
<script src="https://unpkg.com/@bitty/pipe"></script>
<!-- For JSDelivr use the code below. -->
<script src="https://cdn.jsdelivr.net/npm/@bitty/pipe"></script>
<script>
// UMD module is exposed through the "pipe" global function.
console.log(pipe);
//=> "[Function: pipe]"
</script>
Import pipe
from package and just compose your functions with it.
import pipe from '@bitty/pipe';
const resolveToNumber = pipe(
(value: unknown) => typeof value === 'number' ? value : parseFloat(value),
(value: number) => Number.isNaN(value) ? 0 : value,
);
resolveToNumber('12389');
//=> 12389
The first pipe argument is an arity N function, so you can receive more than one argument in the composition.
import pipe from '@bitty/pipe';
const fromTextToWords = (text: string, wordsToIgnore: string[] = []) =>
text
.trim()
.split(/\s+/)
.filter((word) => !wordsToIgnore.includes(word));
const formatToInitials = pipe(
fromTextToWords,
(words) => words.map((word) => word.charAt(0)),
(initials) => initials.join('').toUpperCase(),
);
formatToInitials('abraão william de santana ', ['de']);
//=> "AWS"
Released under MIT License.
FAQs
A pipe function to perform function composition in LTR (Left To Right) direction.
The npm package @bitty/pipe receives a total of 8,128 weekly downloads. As such, @bitty/pipe popularity was classified as popular.
We found that @bitty/pipe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.