Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@absolunet/joi

absolunet459MITdeprecated0.3.0

Switch to '@valtech-commerce/joi'

joi extensions + extra goodies

joi

readme

@absolunet/joi

npm npm dependencies npms Travis CI

joi extensions + extra goodies

Install

$ npm install @absolunet/joi

Usage

import { Joi, validateArgument } from '@absolunet/joi';

class MyClass () {

    constructor(path, value) {
        validateArgument('path',  path,  Joi.absolutePath().required());
        validateArgument('value', value, Joi.number().required());

        // Do your stuff
    }

}

Extensions

absolutePath

Validate that the value is an absolute *nix or Windows path.

joiSchema

Validate that the value is a joi schema.

kebabCase

Validate that the value is kebab-case.

variableName

Validate that the value is a JavaScript valid variable name via is-var-name.

Documentation

View documentation



License

MIT © Absolunet

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.3.0 - 2020-01-13

Changed

  • variableName supports dot separated notation
  • Upgrade to joi 17
  • Maintenance updates

0.2.0 - 2019-12-12

Added

  • kebabCase extension

Changed

  • validateArgument accepts undefined value
  • Code refactor
  • Tests migration to Given-When-Then
  • Maintenance updates

0.1.0 - 2019-11-12

Added

  • Initial