valudate

Provides helpers to test for values rather than types.

Usage no npm install needed!

<script type="module">
  import valudate from 'https://cdn.skypack.dev/valudate';
</script>

README

Build Status Coverage Status Dependency Status

valudate

Provides helpers to test for values rather than types.

Installation

With npm:

$ npm install valudate

With yarn:

$ yarn add valudate

The validation tests categories

theValueIs

Value validation tests that returns `true` if the value pass the test and `false` if it fails the test.

Test name Description
aNonEmptyString Test if a value is a non empty string.
aNonEmptyObject Test if a value is a non empty object.
defined Test if a value is defined.
definedAndNotNull Test if a value is defined and not null.
notDefined Test if a value is `undefined`.
notDefinedOrNull Test if a value is `undefined` or `null`.

theValueMust

Value validation tests that throws when the value fails the test.

Test name Description
beANonEmptyObject
beANonEmptyString
beDefined Test if the value is defined

See also


© 2019 Jean Gregory Verret gregory.verret@gmail.com.