This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@shopify/predicates
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

@shopify/predicates

Build Status 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.

Readme

Keywords

none

Package Sidebar

Install

npm i @shopify/predicates

Weekly Downloads

18,380

Version

3.1.0

License

MIT

Unpacked Size

9.37 kB

Total Files

15

Last publish

Collaborators

  • jaimie.rockburn
  • jaykay101
  • maryharte
  • mishsmelle
  • netlohan
  • pmoloney89
  • shopify-admin
  • shopify-dep