Skip to content

hugomcm/util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FP util lib

Install

$ npm i github:hugomcm/util

Usage

Import

const { R, F, S, $, T, M, H } = require('@hugomcm/util')

// R (Ramda);
// F (Fluture);
// S (Sanctuary);
// $ (Sanctuary Types);
// T (Time)*;
// M (Math)*;
// H (My own generic pointfree functions)*

// *May have some non pure functions

Examples

pr('Hello World!')
// Hello World!

const arr = ['a', 'b', 'c', 'd']
const i = S.pipe([
  //
  H.findIndex(v => v === 'c'),
  H.tap(),
])(arr)
// TAP#1: 2

pr(i)
// 2

const decimalPlaces = 2
pr(M.roundA(decimalPlaces)(1.2342))
// 1.23

Releases

No releases published

Packages

No packages published