πŸ”
verifica
CtrlK
  • Verifica
  • Getting started
    • πŸ“¦Installation
    • πŸ§‘β€πŸŽ“ Examples
      • πŸ§‘β€πŸŽ“ Basic
      • πŸ§‘β€πŸŽ“ Multiple conditions
      • πŸ§‘β€πŸŽ“ Optional
      • πŸ§‘β€πŸŽ“ Custom rules
      • πŸ§‘β€πŸŽ“ With express.js
    • 🟦Typescript
  • Functions
    • asVerificable
    • isValid
    • getErrors
    • ensure
    • rawValue
  • Predicates
    • Built-in Predicates
      • isArray
      • isArrayLength
      • isArrayOf
      • isBoolean
      • isFiniteNumber
      • isInteger
      • isNumber
      • isNumberInRange
      • isObject
      • isOneOf
      • isRegexMatch
      • isString
      • isStringLength
    • Operations on Predicates
      • all
      • optional
    • Custom Predicates
Powered by GitBook
On this page

Was this helpful?

  1. Getting started
  2. πŸ§‘β€πŸŽ“ Examples

πŸ§‘β€πŸŽ“ Basic

The most basic example can be as simple as:

const { asVerificable, isString, ensure } = require("verifica");

function sayHello(name) {
    const vname = asVerificable(name);
    ensure(vname, isString);
    
    console.log(`Hello, ${name}!`);
}
PreviousπŸ§‘β€πŸŽ“ ExamplesNextπŸ§‘β€πŸŽ“ Multiple conditions

Last updated 5 years ago

Was this helpful?