Pure Function, More Attention
//object
_.each<string, string>({ 1: 'a', 2: 'b', 3: 'c' }, (v,k)=>{})
//dom list
_.each<HTMLElement>(document.body.children, (el)=>{})
//array
_.each([1, 2, 3], num=>{})
//set
_.each(new Set([1, 2, 3]), num=>{})
English | 中文
Func.js
Func.js is a TS library of pure functions, providing developers with a more convenient, comprehensive, and diversified declarative programming experience.
Features
- Unified interface for collections and other modules
- 200+ Pure functions
- Lazy evaluation
- Tree APIs
- Full dateTime/number formatter
- and more...
Quick start
- install
npm i @holyhigh/func.js
- import
import _ from '@holyhigh/func.js'
//or
import {each} from '@holyhigh/func.js'
//or
import {each,map} from '@holyhigh/func.js/collection'
//or
import _ from 'https://cdn.skypack.dev/@holyhigh/func.js'
Development
- use
test
to do jest - use
build
to rollup func.js - use
doc
to gen tsdoc