Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pipeable-es-fns

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pipeable-es-fns

A opinionated pipeable ES6+ util functions.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pipeable-es-fns

A typed, curried, ES6+ functions library for pipe style programming.

Use it when

  • You like pipe style programming.
  • But Ramda is too cumbersome for you.
  • And fp-ts introduce too many FP concepts than you want.
  • You just want to use native ES6+ functions with pipe style programming.

Example

import {array, object, pipe} from 'pipeable-es-fns'

const _a = pipe(
  [1, 2, 3],
  array.map((a) => [a, a] as const),
  object.fromEntries
)

const _b = pipe({a: 1, b: 2}, object.entries, object.fromEntries)

Design philosophy

  1. Just curried the ES6+ functions and try to keep others untouched.
  2. Just use the TypeScript official type definitions of ES6+ functions.
  3. Just delegate the implementation to the native ES6+ functions for avoid runtime.
  4. Unlike Ramda, the pipe function accepts data as it's first argument for better type inference.
  5. Organize the functions in a namespace rather than function overload for better type inference.
  6. Doesn't support deprecated methods intentionally.
  7. Encourage to specify the optional arguments implicitly.
  8. Encourage to use one function in one way only.

Keywords

FAQs

Package last updated on 14 Feb 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc