• Version 1.2.7
  • Published
  • 4.62 kB
  • No dependencies
  • MIT license


npm i @types/range-parser
yarn add @types/range-parser
pnpm add @types/range-parser


TypeScript definitions for range-parser



function RangeParser

RangeParser: (
size: number,
str: string,
options?: RangeParser.Options
) => RangeParser.Result | RangeParser.Ranges;
  • When ranges are returned, the array has a "type" property which is the type of range that is required (most commonly, "bytes"). Each array element is an object with a "start" and "end" property for the portion of the range.


    -1 when unsatisfiable and -2 when syntactically invalid, ranges otherwise.


interface Options

interface Options {}

    property combine

    combine?: boolean | undefined;
    • The "combine" option can be set to true and overlapping & adjacent ranges will be combined into a single range.

    interface Range

    interface Range {}

      property end

      end: number;

        property start

        start: number;

          interface Ranges

          interface Ranges extends Array<Range> {}

            property type

            type: string;

              Type Aliases

              type Result

              type Result = ResultUnsatisfiable | ResultInvalid;

                type ResultInvalid

                type ResultInvalid = -2;

                  type ResultUnsatisfiable

                  type ResultUnsatisfiable = -1;

                    Package Files (1)

                    Dependencies (0)

                    No dependencies.

                    Dev Dependencies (0)

                    No dev dependencies.

                    Peer Dependencies (0)

                    No peer dependencies.


                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/range-parser.

                    • Markdown
                    • HTML
                      <a href="https://www.jsdocs.io/package/@types/range-parser"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>