# assertValidSplitWeights
Source: https://docs.maelstrom-ai.co/dev/reference/protocol/functions/assertvalidsplitweights/
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.

> **assertValidSplitWeights**(`weights`): `void`

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

Throws unless `weights` satisfies the invariant [ParsedTilingSplit](https://docs.maelstrom-ai.co/dev/reference/protocol/interfaces/parsedtilingsplit/) documents: 2 to `MAX_SPLIT_CHILDREN` entries, each an integer from 1 to `MAX_SPLIT_WEIGHT`.

[parseTilingSplitToken](https://docs.maelstrom-ai.co/dev/reference/protocol/functions/parsetilingsplittoken/) clamps its way to that invariant, so nothing it returns can violate it — but the type is a plain `number[]`, and every other path that builds a weighted split (a renderer’s child list, a test fixture, a healer rewriting an arity) type-checks fine with `0`, `-5` or `1.5`. Those values do not fail loudly downstream; they produce a region of zero or negative extent, or a normalizing sum that no longer divides the parent cleanly. Construction is the last point where the offending value is still attributable to the code that invented it.

## Parameters

### weights

readonly `number`\[\]

## Returns

`void`
