requireGridRangeContainedIn
function requireGridRangeContainedIn(
gridRange: GridRange,
containerGridRange: GridRange,
message?: string
): GridRange;
The assertion form of isGridRangeContainedIn. The default message names both ranges in A1 notation, which is what makes the failure readable in an execution log.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The grid range that must be contained. |
|
| The grid range expected to contain it. |
|
| The message of the exception. A default naming both ranges is used when omitted. |
Returns
GridRange — the first range, unchanged.
Throws
Exception | Condition |
|---|---|
| the first range is not contained in the second. |
Examples
Guarding a write
const inner = { startRowIndex: 1, endRowIndex: 2, startColumnIndex: 1, endColumnIndex: 2 };
const outer = { startRowIndex: 0, endRowIndex: 5, startColumnIndex: 0, endColumnIndex: 5 };
requireGridRangeContainedIn(inner, outer); // => the inner range
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.