Gathering detailed insights and metrics for @httpland/accept-ranges-parser
Gathering detailed insights and metrics for @httpland/accept-ranges-parser
npm install @httpland/accept-ranges-parser
Typescript
Module System
Node Version
NPM Version
70.3
Supply Chain
90.3
Quality
75.4
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
2,942
Last Day
1
Last Week
5
Last Month
30
Last Year
1,985
MIT License
17 Commits
2 Branches
2 Contributors
Updated on Mar 27, 2023
Minified
Minified + Gzipped
Latest Version
1.0.1
Package Id
@httpland/accept-ranges-parser@1.0.1
Unpacked Size
14.66 kB
Size
3.72 kB
File Count
23
NPM Version
8.19.4
Node Version
16.20.0
Published on
Apr 29, 2023
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
-28.6%
5
Compared to previous week
Last Month
150%
30
Compared to previous month
Last Year
107.4%
1,985
Compared to previous year
2
HTTP Accept-Ranges header field parser.
Compliant with RFC 9110, 14.3. Accept-Ranges.
Parses string into AcceptRanges.
1import { parseAcceptRanges } from "https://deno.land/x/accept_ranges_parser@$VERSION/parse.ts"; 2import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; 3 4assertEquals(parseAcceptRanges(`none`), ["none"]); 5assertEquals(parseAcceptRanges(`bytes, unknown`), ["bytes", "unknown"]);
Throws SyntaxError
if the input is invalid
<Accept-Ranges>
syntax.
1import { parseAcceptRanges } from "https://deno.land/x/accept_ranges_parser@$VERSION/parse.ts"; 2import { assertThrows } from "https://deno.land/std/testing/asserts.ts"; 3 4assertThrows(() => parseAcceptRanges("<invalid>"));
Serialize string of array into string.
1import { stringifyAcceptRanges } from "https://deno.land/x/accept_ranges_parser@$VERSION/stringify.ts"; 2import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; 3 4assertEquals(stringifyAcceptRanges(["bytes"]), "bytes");
Throws TypeError
if the element contains invalid
<range-unit>
syntax.
1import { stringifyAcceptRanges } from "https://deno.land/x/accept_ranges_parser@$VERSION/stringify.ts"; 2import { assertThrows } from "https://deno.land/std/testing/asserts.ts"; 3 4assertThrows(() => stringifyAcceptRanges(["<invalid>", "none"]));
AcceptRanges
is a subtype of array with the following characteristics.
Represents a character set that compliant with RFC 9110, 5.6.2. Tokens as much as possible.
All APIs can be found in the deno doc.
Copyright © 2023-present httpland.
Released under the MIT license
No vulnerabilities found.
No security vulnerabilities found.