import { parseRange } from "https://deno.land/x/range_request_middleware@1.3.0/deps.ts";
Parses a string into Range.
Examples
Example 1
Example 1
import { parseRange } from "https://deno.land/x/range_parser@$VERSION/parse.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
const actual = parseRange("bytes=0-100, 200-, -300");
assertEquals(actual, {
rangeUnit: "bytes",
rangeSet: [
{ firstPos: 0, lastPos: 100 },
{ firstPos: 200, lastPos: undefined },
{ suffixLength: 300 },
],
});