Socket
Socket
Sign inDemoInstall

@sullux/fp-light-always

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @sullux/fp-light-always

A lightweight functional library for functional composition and object composition.


Version published
Weekly downloads
1
Maintainers
1
Install size
2.48 kB
Created
Weekly downloads
 

Readme

Source

home

fp-light-always

npm i @sullux/fp-light-always source test

The always utility wraps a static value in a function. While simple as far as utilities go, it can add readability to functional code.

  • always

always

always<T>(value: T): T

The following example uses always to return a pre-determined value from a thennable.

const { curry } = require('@sullux/fp-light-curry')
const AWS = require('aws-sdk')

const s3 = new AWS.s3()

const saveObject = curry((key, object) =>
  s3.putObject({
    Body: JSON.stringify(object),
    Bucket: process.env.BUCKET,
    Key: key,
  }).promise().then(always(object)))

Keywords

FAQs

Last updated on 16 Feb 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc