# Bytes.assert

Asserts if the given value is [`Bytes.Bytes`](/api/Bytes/types#bytes).

## Imports

:::code-group
```ts [Named]
import { Bytes } from 'ox'
```

```ts [Entrypoint]
import * as Bytes from 'ox/Bytes'
```
:::

## Examples

```ts twoslash
import { Bytes } from 'ox'

Bytes.assert('abc')
// @error: Bytes.InvalidBytesTypeError:
// @error: Value `"abc"` of type `string` is an invalid Bytes value.
// @error: Bytes values must be of type `Uint8Array`.
```

## Definition

```ts
function assert(
  value: unknown,
): asserts value is Bytes
```

**Source:** [src/core/Bytes.ts](https://github.com/wevm/ox/blob/main/src/core/Bytes.ts#L890)

## Parameters

### value

* **Type:** `unknown`

Value to assert.
