# formatTilingSplitToken
Source: https://docs.maelstrom-ai.co/dev/reference/protocol/functions/formattilingsplittoken/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **formatTilingSplitToken**(`axis`, `weights`): [`TilingSplitToken`](https://docs.maelstrom-ai.co/dev/reference/protocol/type-aliases/tilingsplittoken/)

Defined in: [packages/protocol/src/lib/response.ts:336](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/protocol/src/lib/response.ts#L336)

Renders an axis and weights back into a token.

Emits the bare axis for an even two-way split, so a tree that arrived unweighted leaves any round trip through the parser unchanged.

The parameter is a two-or-more tuple because a split with fewer children than that is not a split: `[1]` would render `"V:1"`, which parses back as an even two-way split and reports itself repaired, breaking the round trip this function exists to preserve.

## Parameters

### axis

[`TilingSplit`](https://docs.maelstrom-ai.co/dev/reference/protocol/type-aliases/tilingsplit/)

### weights

readonly \[`number`, `number`, `number`\]

## Returns

[`TilingSplitToken`](https://docs.maelstrom-ai.co/dev/reference/protocol/type-aliases/tilingsplittoken/)

## Throws

If `weights` breaks the invariant [assertValidSplitWeights](https://docs.maelstrom-ai.co/dev/reference/protocol/functions/assertvalidsplitweights/) enforces: fewer than 2 or more than `MAX_SPLIT_CHILDREN` entries, or an entry that is not an integer from 1 to `MAX_SPLIT_WEIGHT`.
