Skip to content
😊 A collection of Javascript pure functions/helpers with 0 dependencies
Branch: master
Clone or download
thibmaek Merge pull request #31 from thibmaek/greenkeeper/flow-bin-0.87.0
Update flow-bin to the latest version πŸš€
Latest commit 82f529e Dec 16, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add release-drafter Github app support Aug 27, 2018
.vscode πŸ”§ Add flowtype support instead of JSDoc Jan 14, 2018
esm Add dates/getMonth dates/getDays Dec 3, 2018
src Add dates/getMonth dates/getDays Dec 3, 2018
.babelrc Configure babel & eslint Aug 28, 2018
.eslintrc Add async/simpleFetch Nov 24, 2018
.flowconfig πŸ”§ Add flowtype support instead of JSDoc Jan 14, 2018
.gitignore βž• Added eslint & eslint-config-devine Sep 14, 2017
.huskyrc Correctly add Husky & lint-staged hooks Sep 6, 2018
.lintstagedrc Add lint-stagedrc Aug 27, 2018
.npmignore πŸ“¦ No trailing slash in __test__ folder for npm ignore Jan 15, 2018
.travis.yml
ACKNOWLEDGMENT.md Add dates/getMonth dates/getDays Dec 3, 2018
LICENSE Update license Aug 28, 2018
README.md Merge branch 'master' into greenkeeper/initial Sep 13, 2018
index.js πŸ”§ Add flowtype support instead of JSDoc Jan 14, 2018
package-lock.json chore(package): update lockfile package-lock.json Nov 28, 2018
package.json chore(package): update flow-bin to version 0.87.0 Nov 28, 2018

README.md

😊 pure-fun

A collection of JavaScript pure functions/helpers with zero dependencies.

Travis CI Chat

Currently ESM support only, use Babel or @std/esm (node v8+) for Node.

Installing

npm install (--save-dev) pure-fun
yarn add (--dev) pure-fun

Usage

import PureFun from 'pure-fun';
const mapArr = PureFun.Objects.getMappedArray({ key:'value' });

import { Arrays } from 'pure-fun';
const rnd = Arrays.pickRandom([1, 2, 3])

import sleep from 'pure-fun/async';
const delayedRes = sleep(1000)
  .then(response => console.log(response));

Development

The dev env for this is Node LTS/latest with ESM (import/export) syntax as a standard. Linting is done with eslint and testing with jest.

For testing, each function should have a unit test in the same directory in a subfolder __tests__ with at least a test that asserts the expected result. You can run tests locally with npm t. Every PR also builds on Travis CI under these circumstances.

You can’t perform that action at this time.