Files
klz-cables.com/.pnpm-store/v10/files/40/8f05111eac36da3d812d6990f44e744c415f0852731199ae9cb54f0112bea779b0e1a31f3d49cbfc455d52fe8ffe7cde9e0267c4eb831de0cb58e4aa58bc38
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

73 lines
2.2 KiB
Plaintext

'use strict';
/**
* Check if a character is a delimiter as defined in section 3.2.6 of RFC 7230.
*
*
* @param {number} code The code of the character to check.
* @returns {boolean} `true` if the character is a delimiter, else `false`.
* @public
*/
function isDelimiter(code) {
return code === 0x22 // '"'
|| code === 0x28 // '('
|| code === 0x29 // ')'
|| code === 0x2C // ','
|| code === 0x2F // '/'
|| code >= 0x3A && code <= 0x40 // ':', ';', '<', '=', '>', '?' '@'
|| code >= 0x5B && code <= 0x5D // '[', '\', ']'
|| code === 0x7B // '{'
|| code === 0x7D; // '}'
}
/**
* Check if a character is allowed in a token as defined in section 3.2.6
* of RFC 7230.
*
* @param {number} code The code of the character to check.
* @returns {boolean} `true` if the character is allowed, else `false`.
* @public
*/
function isTokenChar(code) {
return code === 0x21 // '!'
|| code >= 0x23 && code <= 0x27 // '#', '$', '%', '&', '''
|| code === 0x2A // '*'
|| code === 0x2B // '+'
|| code === 0x2D // '-'
|| code === 0x2E // '.'
|| code >= 0x30 && code <= 0x39 // 0-9
|| code >= 0x41 && code <= 0x5A // A-Z
|| code >= 0x5E && code <= 0x7A // '^', '_', '`', a-z
|| code === 0x7C // '|'
|| code === 0x7E; // '~'
}
/**
* Check if a character is a printable ASCII character.
*
* @param {number} code The code of the character to check.
* @returns {boolean} `true` if `code` is in the %x20-7E range, else `false`.
* @public
*/
function isPrint(code) {
return code >= 0x20 && code <= 0x7E;
}
/**
* Check if a character is an extended ASCII character.
*
* @param {number} code The code of the character to check.
* @returns {boolean} `true` if `code` is in the %x80-FF range, else `false`.
* @public
*/
function isExtended(code) {
return code >= 0x80 && code <= 0xFF;
}
module.exports = {
isDelimiter: isDelimiter,
isTokenChar: isTokenChar,
isExtended: isExtended,
isPrint: isPrint
};