# ts-invariant

[TypeScript](https://www.typescriptlang.org) implementation of [`invariant(condition, message)`](https://www.npmjs.com/package/invariant).

Supports `invariant.log`, `invariant.warn`, and `invariant.error`, which wrap `console` methods of the same name, and may be stripped in production by [`rollup-plugin-invariant`](https://github.com/pingponglabs/mediamagic-platform/blob/main/services/graphql-gateway/archived/rollup-plugin-invariant/README.md).

The verbosity of these methods can be globally reconfigured using the `setVerbosity` function:

```ts
import { setVerbosity } from "ts-invariant";

setVerbosity("log"); // display all messages (default)
setVerbosity("warn"); // display only warnings and errors
setVerbosity("error"); // display only errors
setVerbosity("silent"); // display no messages
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mediamagic.dev/product-docs/services/graphql-gateway/node_modules/ts-invariant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
