Giter Club home page Giter Club logo

pure-conditions's Introduction

pure-conditions

npm build

A set of pure functions.

Table of Contents

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

const { hasDuplicates } = require('pure-conditions')
hasDuplicates(['foo', 'foo']) // true
const { isEmpty } = require('pure-conditions')
isEmpty({ foo: 'bar' }) // false
const { endsWith } = require('pure-conditions')
endsWith('foo bar', 'bar') // true
const { isEmail } = require('pure-conditions')
isEmail('[email protected]') // true

Maintainers

@emilos

Contributing

Pull requests and issues are always welcome.

License

MIT

pure-conditions's People

Contributors

cieplus avatar dependabot[bot] avatar emilos avatar inikonorov avatar pkonieczniak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

inikonorov

pure-conditions's Issues

update isEmptyObject

function isObjectEmpty (object) {
  return Object.keys(object).length === 0 && object.constructor === Object
}

Array elements comparison

We can add two methods for comparison values of arrays.
One of them can check that values are the same and in the following order the second one can check only if the arrays have the same elements.

Split methods into separate files.

index.js should still require all deps and export them. This change will make it easier to import methods individually and avoid tree shaking for bundlers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.