MCPcopy
hub / github.com/di-sukharev/opencommit / matchHeaderValue

Function matchHeaderValue

out/cli.cjs:72028–72042  ·  view source on GitHub ↗
(context, value, header, filter2, isHeaderNameFilter)

Source from the content-addressed store, hash-verified

72026 const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
72027 let match;
72028 while (match = tokensRE.exec(str2)) {
72029 tokens[match[1]] = match[2];
72030 }
72031 return tokens;
72032}
72033var isValidHeaderName = (str2) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str2.trim());
72034function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
72035 if (utils_default.isFunction(filter2)) {
72036 return filter2.call(this, value, header);
72037 }
72038 if (isHeaderNameFilter) {
72039 value = header;
72040 }
72041 if (!utils_default.isString(value)) return;
72042 if (utils_default.isString(filter2)) {
72043 return value.indexOf(filter2) !== -1;
72044 }
72045 if (utils_default.isRegExp(filter2)) {

Callers 3

hasMethod · 0.85
deleteHeaderMethod · 0.85
clearMethod · 0.85

Calls 1

testMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…