Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buxlabs/pure-conditions
A set of pure functions
https://github.com/buxlabs/pure-conditions
Last synced: about 1 month ago
JSON representation
A set of pure functions
- Host: GitHub
- URL: https://github.com/buxlabs/pure-conditions
- Owner: buxlabs
- License: mit
- Created: 2018-06-03T19:46:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-31T16:05:24.000Z (over 1 year ago)
- Last Synced: 2024-11-29T18:09:13.281Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 273 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pure-conditions
[![npm](https://img.shields.io/npm/v/pure-conditions.svg)](https://www.npmjs.com/package/pure-conditions)
[![build](https://github.com/buxlabs/pure-conditions/workflows/build/badge.svg)](https://github.com/buxlabs/pure-conditions/actions)> A set of pure functions.
## Table of Contents
- [Background](#background)
- [Install](#install)
- [Usage](#usage)
- [API](https://buxlabs.pl/en/tools/js/pure-conditions)
- [Maintainers](#maintainers)
- [Contributing](#contributing)
- [License](#license)## Background
The library is a set of functions that can make developement easier by handling the most popular condition statements. Functions are pure, which means that they do not have side effects and have predictible output. The functions are isolated and do not depend on each other which makes it easier for bundlers and compilers to consume them.
## Install
```
npm install pure-conditions
```## Usage
```js
const { hasDuplicates } = require('pure-conditions')
hasDuplicates(['foo', 'foo']) // true
``````js
const { isEmpty } = require('pure-conditions')
isEmpty({ foo: 'bar' }) // false
``````js
const { endsWith } = require('pure-conditions')
endsWith('foo bar', 'bar') // true
``````js
const { isEmail } = require('pure-conditions')
isEmail('[email protected]') // true
```## Maintainers
[@emilos](https://github.com/emilos)
## Contributing
Pull requests and issues are always welcome.## License
MIT