@breeffy/react-native-invariant
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

React Native Invariant

npm npm

invariant and assert functions with types for React Native.

Overview

Two functions with the same signatures are provided.

invariant(condition, message, prefix) and assert(condition, message, prefix).

The only difference is in default prefix value.

@param condition, type: any, description: If it's falsy - exception will be thrown, otherwise TypeScript asserts condition. See Assertion Functions.

@param message, type: string | undefined, description: Error message to use if exception will be thrown. Default is "".

@param prefix, type: string | undefined, description: Prefix string to use before error message if exception will be thrown. For assert default is "[assert] ", for invariant default is "[invariant] ".

License

react-native-invariant is licensed under Apache-2.0 license.

Copyright © 2021, Victor Malov.

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @breeffy/react-native-invariant

    Weekly Downloads

    3

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    17.1 kB

    Total Files

    8

    Last publish

    Collaborators

    • victor.malov