This package has been deprecated

Author message:

move to @the-/check ( https://github.com/the-labo/the/tree/master/packages/check#readme )

the-check

2.0.23 • Public • Published

the-check

Build Status npm Version JS Standard

Check utility for the-framework

Installation

$ npm install the-check --save

Usage

'use strict'
 
const { unlessProduction } = require('the-check')
 
async function tryExample () {
 
  function myFunc (someArg) {
    // Run check only if `process.env.NODE_ENV !=== 'production'`
    unlessProduction(({ ok, equal }) => {
      ok(someArg, 'someArg is required!')
      equal(typeof someArg === 'string', 'someArg must be a string!')
    })
  }
 
  myFunc('hoge')
}
 
tryExample().catch((err) => console.error(err))
 

API Guide

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i the-check

Weekly Downloads

14

Version

2.0.23

License

MIT

Unpacked Size

74.3 kB

Total Files

62

Last publish

Collaborators

  • okunishinishi