@httpland/range-parser
Advanced tools
Comparing version
// Copyright 2023-latest the httpland authors. All rights reserved. MIT license. | ||
// This module is browser compatible. | ||
import { isNotEmpty, isNumber, isString, isUndefined, trim } from "./deps.js"; | ||
const RangeSpecifierRe = /^(?<rangeUnit>([!#$%&'*+-.^_`|~A-Za-z0-9])+)=(?<rangeSet>((([0-9])+-(([0-9])+)?)|(-([0-9])+)|([\x21-\x2B\x2D-\x7E]+))((\x20|\t)*,(\x20|\t)*((([0-9])+-(([0-9])+)?)|(-([0-9])+)|([\x21-\x2B\x2D-\x7E]+)))*)$/; | ||
const RangeSpecifierRe = /^(?<rangeUnit>([\w!#$%&'*+-.^`|~])+)=(?<rangeSet>(((\d)+-((\d)+)?)|(-(\d)+)|([\x21-\x2B\x2D-\x7E]+))([\t ]*,[\t ]*(((\d)+-((\d)+)?)|(-(\d)+)|([\x21-\x2B\x2D-\x7E]+)))*)$/; | ||
var Msg; | ||
@@ -50,3 +50,3 @@ (function (Msg) { | ||
} | ||
const RangeSpecRe = /^((?<firstPos>[0-9]+)-(?<lastPos>[0-9]+)?)$|^(-(?<suffixLength>[0-9]+))$|^(?<otherRange>[\x21-\x2B\x2D-\x7E]+)$/; | ||
const RangeSpecRe = /^((?<firstPos>\d+)-(?<lastPos>\d+)?)$|^(-(?<suffixLength>\d+))$|^(?<otherRange>[\x21-\x2B\x2D-\x7E]+)$/; | ||
export function parseRangeSpec(input) { | ||
@@ -53,0 +53,0 @@ const result = RangeSpecRe.exec(input); |
@@ -6,3 +6,3 @@ { | ||
"name": "@httpland/range-parser", | ||
"version": "1.0.0", | ||
"version": "1.0.1-beta.1", | ||
"description": "HTTP Range header field parser", | ||
@@ -9,0 +9,0 @@ "keywords": [ |
@@ -7,3 +7,3 @@ "use strict"; | ||
const deps_js_1 = require("./deps.js"); | ||
const RangeSpecifierRe = /^(?<rangeUnit>([!#$%&'*+-.^_`|~A-Za-z0-9])+)=(?<rangeSet>((([0-9])+-(([0-9])+)?)|(-([0-9])+)|([\x21-\x2B\x2D-\x7E]+))((\x20|\t)*,(\x20|\t)*((([0-9])+-(([0-9])+)?)|(-([0-9])+)|([\x21-\x2B\x2D-\x7E]+)))*)$/; | ||
const RangeSpecifierRe = /^(?<rangeUnit>([\w!#$%&'*+-.^`|~])+)=(?<rangeSet>(((\d)+-((\d)+)?)|(-(\d)+)|([\x21-\x2B\x2D-\x7E]+))([\t ]*,[\t ]*(((\d)+-((\d)+)?)|(-(\d)+)|([\x21-\x2B\x2D-\x7E]+)))*)$/; | ||
var Msg; | ||
@@ -56,3 +56,3 @@ (function (Msg) { | ||
exports.parseRangesSpecifier = parseRangesSpecifier; | ||
const RangeSpecRe = /^((?<firstPos>[0-9]+)-(?<lastPos>[0-9]+)?)$|^(-(?<suffixLength>[0-9]+))$|^(?<otherRange>[\x21-\x2B\x2D-\x7E]+)$/; | ||
const RangeSpecRe = /^((?<firstPos>\d+)-(?<lastPos>\d+)?)$|^(-(?<suffixLength>\d+))$|^(?<otherRange>[\x21-\x2B\x2D-\x7E]+)$/; | ||
function parseRangeSpec(input) { | ||
@@ -59,0 +59,0 @@ const result = RangeSpecRe.exec(input); |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
112196
-0.07%1
Infinity%