1.0.6-1 • Published 8 years ago

micro-utils v1.0.6-1

Weekly downloads
9
License
MIT
Repository
github
Last release
8 years ago

Utils

A micro library of utils with a functional taste

Installation

npm i micro-utils

Examples

import utils from 'micro-utils';

const someFnWithErrors = (err) => (
    utils.fail(err)
);

const ifNotUndefinedOrNull = (x) => (
    // true
    utils.existy(x)
);

const ifNotUndefinedNullOrFalse = (x) => (
    // true
    utils.truthy(x)
);

const ifEmpty = (x) => (
    // true if length === 0
    utils.empty(x)
);

const ifValid = (x) => (
    // true truthy && !empty
    utils.valid(x)
);

const ifIncludes = (arr, elem) => (
    // true if elem present in the array
    utils.includes(arr, elem)
);
1.0.6-1

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago