LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsnodenormalizeReadPagination
Function●Since v1.13

normalizeReadPagination

Normalize model- or caller-supplied text pagination bounds.

Every backend must slice content and calculate pagination metadata from the same normalized values. Otherwise a fractional or negative argument could return one window while advertising a different nextOffset.

Binary reads do not use this helper because their backend contract ignores line-based offset and limit values.

Copy
normalizeReadPagination(offset: number, limit: number): __type

Parameters

NameTypeDescription
offset*number
limit*number
View source on GitHub