@nuware/invariant

    1.0.2 • Public • Published

    invariant

    npm (scoped) NPM Snyk Vulnerabilities for npm package version

    Install

    npm install @nuware/invariant --save

    or

    <script defer src="https://unpkg.com/@nuware/invariant@latest/dist/invariant.umd.js"></script>

    or

    <script defer src="https://unpkg.com/@nuware/invariant@latest/dist/invariant.umd.min.js"></script>

    Usage

    Browser

    const invariant = window.nuware.invariant

    Node

    const {invariant} = require('@nuware/invariant')

    or

    import {invariant} from '@nuware/invariant'

    API

    import {
      invariant,
      raiseError
    } from '@nuware/invariant'

    invariant :: (*, String message) -> void

    invariant(trueValue, 'if true')
    
    invariant(falseValue, 'if false')
    // => Error: Invariant: if false

    raiseError :: (String message, String prefix) -> void

    raiseError('some error', 'MyPrefix:')
    // => Error: MyPrefix: some error

    License

    MIT License

    Author

    Dmitry Dudin dima@nuware.ru

    Keywords

    none

    Install

    npm i @nuware/invariant

    DownloadsWeekly Downloads

    3

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    7.67 kB

    Total Files

    9

    Last publish

    Collaborators

    • outbreak