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

Function validateName

out/cli.cjs:6402–6407  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

6400 var invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
6401 var invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
6402 function validateName(name) {
6403 name = `${name}`;
6404 if (invalidTokenRegex.test(name) || name === "") {
6405 throw new TypeError(`${name} is not a legal HTTP header name`);
6406 }
6407 }
6408 function validateValue(value) {
6409 value = `${value}`;
6410 if (invalidHeaderCharRegex.test(value)) {

Callers 5

getMethod · 0.85
setMethod · 0.85
appendMethod · 0.85
hasMethod · 0.85
deleteMethod · 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…