# wrapBidi

Source: https://pakdatakit.dev/api/typescript/text/functions/wrapbidi/

```ts
function wrapBidi(text, direction?): string;
```

Defined in: [text.ts:436](https://github.com/chmuzamil/pakdatakit/blob/a6eeaa47381308c4e4fcda45b29642fe4fbfb1fc/src/text.ts#L436)

Wraps text in Unicode directional isolates, so a name or number in one
direction does not reorder the sentence around it (for example an English
order number inside an Urdu message).

Uses FIRST STRONG ISOLATE (U+2068) by default, RIGHT-TO-LEFT ISOLATE
(U+2067) for `rtl` and LEFT-TO-RIGHT ISOLATE (U+2066) for `ltr`, closed
with POP DIRECTIONAL ISOLATE (U+2069). Any other direction is `auto`.

## Parameters

| Parameter | Type | Default value |
| :------ | :------ | :------ |
| `text` | `string` | `undefined` |
| `direction?` | [`BidiDirection`](https://pakdatakit.dev/api/typescript/text/type-aliases/bididirection/) | `'auto'` |

## Returns

`string`

The wrapped text, or `''` when the input is not a string. Never
  throws.

## Example

```ts
`آرڈر ${wrapBidi('PDK-1042')} بھیج دیا گیا`;
```
