@shopify/predicates
A set of common Javascript predicates
Last updated 21 days ago by shopify-dep .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @shopify/predicates 
SYNC missed versions from official npm registry.

@shopify/predicates

Build Status License: MIT npm version

A set of common Javascript predicates. The functions in this library either take one input and return true / false, or return a customized function that does so.

Installation

$ yarn add @shopify/predicates

API

Predicates

  • isPositiveNumericString Returns true when its input is a positive numeric string and false otherwise.
  • isNumericString Returns true when its input is a numeric string and false otherwise.
  • isEmpty Returns true when its input is null, undefined, or has length 0.
  • isEmptyString Returns true when it's input is an empty string or contains only whitespace.
  • notEmpty Returns true when its input is not null, undefined or has length 0.
  • notNumericString Returns true when its input is not a numeric string and false otherwise.

Predicate creators

  • lengthMoreThan Given a number, returns a function that returns true when that input has length more than that number and false otherwise.
  • lengthLessThan Given a number, returns a function that returns true when that input has length less than that number and false otherwise.

Helpers

  • not Given a function that returns a boolean, returns a function that returns a boolean in the opposite cases.

Current Tags

  • 1.2.3                                ...           latest (21 days ago)

6 Versions

  • 1.2.3                                ...           21 days ago
  • 1.2.2                                ...           a month ago
  • 1.2.1                                ...           3 months ago
  • 1.2.0                                ...           6 months ago
  • 1.1.0                                ...           7 months ago
  • 1.0.0                                ...           8 months ago
Downloads
Today 0
This Week 6
This Month 6
Last Day 0
Last Week 0
Last Month 36
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |