# @types/range-parser

> TypeScript definitions for range-parser

Latest version **1.2.7** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/range-parser
pnpm add @types/range-parser
yarn add @types/range-parser
bun add @types/range-parser
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.7 |
| Published | 2023-11-07 |
| First published | 2017-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51433 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/range-parser
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/range-parser
- npm.io page: https://npm.io/package/@types/range-parser

## Recent versions

- 1.2.7 (latest) — 2023-11-07
- 1.2.4 (ts3.6) — 2021-07-07
- 1.2.3 (ts2.0) — 2018-12-07
- 1.2.6 — 2023-10-18
- 1.2.5 — 2023-09-27
- 1.2.2 — 2018-06-05
- 1.2.1 — 2017-03-31
- 1.2.0 — 2017-02-10

## README

# Installation
> `npm install --save @types/range-parser`

# Summary
This package contains type definitions for range-parser (https://github.com/jshttp/range-parser).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/range-parser.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/range-parser/index.d.ts)
````ts
/**
 * 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.
 */
declare function RangeParser(
    size: number,
    str: string,
    options?: RangeParser.Options,
): RangeParser.Result | RangeParser.Ranges;

declare namespace RangeParser {
    interface Ranges extends Array<Range> {
        type: string;
    }
    interface Range {
        start: number;
        end: number;
    }
    interface Options {
        /**
         * The "combine" option can be set to `true` and overlapping & adjacent ranges
         * will be combined into a single range.
         */
        combine?: boolean | undefined;
    }
    type ResultUnsatisfiable = -1;
    type ResultInvalid = -2;
    type Result = ResultUnsatisfiable | ResultInvalid;
}

export = RangeParser;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Tomek Łaziuk](https://github.com/tlaziuk).

---
_Source: https://npm.io/package/@types/range-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
