Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/predicates

Package Overview
Dependencies
Maintainers
24
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/predicates

A set of common JavaScript predicates

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
60K
increased by17.54%
Maintainers
24
Weekly downloads
 
Created
Source

@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.

FAQs

Package last updated on 10 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc