npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ramda-validations

v1.0.0

Published

Ramda Validations

Downloads

3

Readme

Ramda Validations

JavaScript type testing library with ramda

Validators List

General

  • isPresent: Checks that input value is present.
isPresent(input: any): boolean;

// Exemple
isPresent("Hello"); //=> true
isPresent([]); //=> false
isPresent({}); //=> false
isPresent(""); //=> false
isPresent(null); //=> false
isPresent(undefined); //=> false
  • isBlank: Checks that input is nil or empty.
isBlank(input: any): boolean;

// Exemple
isBlank(""); //=> true
isBlank(" "); //=> true
isBlank(null); //=> true
isBlank(undefined); //=> true
isBlank([]); //=> true
isBlank({}); //=> true
isBlank(0); //=> false
isBlank(false); //=> false
  • isOtherThan: Checks that a value is other than b value.
isOtherThan(a: any, b: any): boolean;

// Exemple
isOtherThan(1, 2); //=> true
isOtherThan([1, 2], [1, 2]); //=> false

Number

  • isEven: Checks that input is even number.
isEven(input: number): boolean;

// Exemple
isEven(2); //=> true
isEven(Infinity); //=> false
isEven(1); //=> false
isEven(2.2); //=> false
  • isOdd: Checks that input is odd number.
isOdd(input: number): boolean;

// Exemple
isOdd(1); //=> true
isOdd(Infinity); //=> false
isOdd(2); //=> false
isOdd(1.1); //=> false
  • isNegative: Checks that input value is a negative number.
isNegative(input: number): boolean;

// Exemple
isNegative(-3); //=> true
isNegative(3); //=> false
  • isPositive: Checks that input value is a positive number.
isPositive(input: number): boolean;

// Exemple
isPositive(3); //=> true
isPositive(-3); //=> false
  • isInteger: Checks that input value is an integer number.
isInteger(input: any): boolean;

// Exemple
isInteger(10); //=> true
isInteger(10.0); //=> true
isInteger(5.12); //=> false
isInteger("Hello World"); //=> false
isInteger(true); //=> false
isInteger([]); //=> false
  • isFloat: Checks that input value is a float number.
isFloat(input: any): boolean;

// Exemple
isFloat(5.12); //=> true
isFloat(10.0); //=> false
isFloat(10); //=> false
isFloat("Hello World"); //=> false
isFloat(true); //=> false
isFloat([]); //=> false
  • isFinite: Checks that input value is a finite number.
isFinite(input: any): boolean;

// Exemple
isFinite(12); //=> true
isFinite(Infinity); //=> false
isFinite(-Infinity); //=> false
  • isMultiple: Checks that a value is a multiple of b value.
isMultiple(a: number, b: number): boolean;

// Exemple
isMultiple(3, 105); //=> true
isMultiple(3, 106); //=> false
  • isInRange: Checks that input value is between from and to value.
isInRange(from: number, to: number): boolean;

//Exemple
isInRange(1, 8, 5); //=> true
isInRange(1, 8, 10); //=> false

String

  • isAlphanum:.
isAlphanum(input: any): boolean;

//Exemple
isAlphanum("123456789"); //=> true
isAlphanum("abcd"); //=> true
isAlphanum("abcd123456789"); //=> true
isAlphanum("abcd1234567,89"); //=> false
  • isString:.
isString(input: any): boolean;

//Exemple
isString("hello"); //=> true
isString(0); //=> false

Boolean

  • isTrue: Checks that input value is equals true.
isTrue(input: any): boolean;

//Exemple
isTrue(true); //=> true
isTrue(Boolean(true)); //=> true
isTrue(false); //=> false
isTrue(Boolean(false)); //=> false
isTrue(1); //=> false
isTrue("hello world"); //=> false
isTrue(123456); //=> false
isTrue(["Hello", "World"]); //=> false
  • isFalse:.
isFalse(input: any): boolean;

//Exemple
isFalse(false); //=> true
isFalse(Boolean(false)); //=> true
isFalse(true); //=> false
isFalse(Boolean(true)); //=> false
isFalse(0); //=> false
isFalse("hello world"); //=> false
isFalse(123456); //=> false
isFalse(["Hello", "World"]); //=> false

Object

  • hasKeys: Checks that input object has keys.
hasKeys(keys: string[], input: object): boolean;

//Exemple
hasKeys(["a", "b"], {a: 1, b: 2}) // => true
hasKeys(["a", "b"], {a: 1}) // => false
  • isObject: Checks that input value is an object.
isObject(input: any): boolean;

//Exemple
isObject({}); //=> true
isObject({ hello: "World" }); //=> true
isObject([]); //=> true
isObject(Function); //=> true
isObject(1); //=> false
  • isHash: Checks that input value is an object hash.
isHash(input: any): boolean;

//Exemple
isHash({}); //=> true
isHash({ hello: "World" }); //=> true
isHash([]); //=> false
isHash(Function); //=> false
isHash(1); //=> false

Promise

  • isPromise: Checks that input value is a promise.
isPromise(input: any): boolean;

//Exemple
const promise = new Promise((resolve, reject) => {});
isPromise(promise); //=> true