---
url: 'https://adk.nht.io/api/batteries/sandbox/node/functions/resolveSearchLimit.md'
---

# Function: resolveSearchLimit()

```ts
function resolveSearchLimit(limit: number | undefined): number | undefined;
```

Defined in: [src/batteries/sandbox/node/search\_ripgrep.ts:78](https://github.com/NHTIO/ADK/blob/v1.20261003.0/src/src/batteries/sandbox/node/search_ripgrep.ts#L78)

Validate an explicit `limit`, permitting full omission (unbounded).

## Parameters

| Parameter | Type                    | Description                                        |
| --------- | ----------------------- | -------------------------------------------------- |
| `limit`   | `number` | `undefined` | The requested limit, or `undefined` for unbounded. |

## Returns

`number` | `undefined`

The validated limit, or `undefined` when unbounded.

## Remarks

Issue #48: the contract previously mandated `limit: number` and the adapter rejected everything
but a positive integer, so an UNBOUNDED search was inexpressible — the searcher forced a cap, and
`Number.MAX_SAFE_INTEGER` is a disguised one. Omission is now the documented unbounded mode: no
post-collection cap, the scan finishes `complete: true`. An EXPLICIT value must still be a positive
integer — `0`, negatives, non-integers, `Infinity` and `NaN` remain rejections, so a caller cannot
accidentally disable the bound they named.
