Socket
Book a DemoInstallSign in
Socket

@hon2a/icepick-fp

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hon2a/icepick-fp

Wrapper around the popular Icepick library providing a FP contract.

0.0.10
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

icepick-fp

Wrapper around the popular Icepick library providing a FP contract.

Use

Install using

npm install @hon2a/icepick-fp

Import using

import { assocIn, dissocIn/*, ...*/ } from '@hon2a/icepick-fp'
// or individually:
import assocIn from '@hon2a/icepick-fp/assocIn'

Contents

Wrappers are provided just for the most often used Icepick transforms for now: assocIn (and setIn alias), getIn, updateIn, assign, and merge. They're enhanced with lodash.topath to accept String paths:

getIn('a.b[0].c')({ a: { b: [{ c: 42 }] } })
// => 42

The freeze and thaw helpers are also re-exported. Additionally, there's a dissocIn transform (deletes just the leaf property)

dissocIn('a.b.c')({ a: { b: { c: 42 } } })
// => { a: { b: {} } }

and a generic reduce helper

reduce(
  (val, idx) => setIn(val, idx),
  {}
)(['a', 'b', 'c'])
// => { a: 1, b: 2, c: 3 }

Development

Install

Install dependencies using:

npm install

Develop

After you modify sources, run the following (or set up your IDE to do it for you):

  • format the code using npm run format
  • lint it using npm run lint
  • test it using npm test

and fix the errors, if there are any.

Publish

Publishing is done in two steps:

  • Create a new version tag and push it to the repository:
    npm version <patch|minor|major>
    git push --follow-tags
    
  • Build and publish the new version as a npm package:
    npm publish --access public
    

FAQs

Package last updated on 28 Nov 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.