3.0.1 • Published 3 years ago

vebs v3.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

verbose

A fork of Facebook's invariant.

The verbose provide a printf-style(only %s is supported) liked API to throw or log a message.

verbose(condition, message)

import verbose from "vebs";

verbose(true, "This will not log");
// nothing happened

verbose(false, "Error message");
// Uncaught Error: Error message ...

verbose(
  false,
  { level: "log", message: "You may have wrong way using [%s]." },
  "vebs"
);
// console.log("You may have wrong way using [vebs].")

Note:

  1. The verbose does not take effect in production mode, it is a dummy function.

  2. Since 2.x.x, it reverse the condition and is consistent with invariant and warning.

Contrary (1.x.x): Compared to invariant, the message will show only when condition is true.

3.0.1

3 years ago

3.0.0

3 years ago

2.0.0

5 years ago

1.0.0

5 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago