@the-/check

15.6.3 • Public • Published

@the-/check

npm Version

Check utility for the-framework

Installation

$ npm install @the-/check --save

Usage

'use strict'

const {
  strict: { equal, ok },
} = require('assert')
const { unlessProduction } = require('@the-/check')

async function tryExample() {
  function myFunc(someArg) {
    // Run check only if `process.env.NODE_ENV !=== 'production'`
    unlessProduction(() => {
      ok(someArg, 'someArg is required!')
      equal(typeof someArg === 'string', 'someArg must be a string!')
    })
  }

  myFunc('hoge')
}

tryExample().catch((err) => console.error(err))

API Guide

See API Guide for more detail

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i @the-/check

Weekly Downloads

0

Version

15.6.3

License

MIT

Unpacked Size

48.1 kB

Total Files

33

Last publish

Collaborators

  • okunishinishi