@types/range-parser

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

Install

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

Overview

TypeScript definitions for range-parser

Index

Functions

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.

    Returns

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

Interfaces

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.

                    Badge

                    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
                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/range-parser)
                    • 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>