MCPcopy Index your code
hub / github.com/nodejs/node / set

Method set

lib/internal/mime.js:168–192  ·  view source on GitHub ↗
(name, value)

Source from the content-addressed store, hash-verified

166 }
167
168 set(name, value) {
169 this.#parse();
170 const data = this.#data;
171 name = `${name}`;
172 value = `${value}`;
173 const invalidNameIndex = SafeStringPrototypeSearch(name, NOT_HTTP_TOKEN_CODE_POINT);
174 if (name.length === 0 || invalidNameIndex !== -1) {
175 throw new ERR_INVALID_MIME_SYNTAX(
176 'parameter name',
177 name,
178 invalidNameIndex,
179 );
180 }
181 const invalidValueIndex = SafeStringPrototypeSearch(
182 value,
183 NOT_HTTP_QUOTED_STRING_CODE_POINT);
184 if (invalidValueIndex !== -1) {
185 throw new ERR_INVALID_MIME_SYNTAX(
186 'parameter value',
187 value,
188 invalidValueIndex,
189 );
190 }
191 data.set(name, value);
192 }
193
194 *entries() {
195 this.#parse();

Callers 14

filterDuplicateStringsFunction · 0.45
getCrossRealmRegexFunction · 0.45
processImmediateFunction · 0.45
listOnTimeoutFunction · 0.45
initFunction · 0.45
writeNumericArgFunction · 0.45
EFunction · 0.45
hideInternalStackFramesFunction · 0.45
#parseMethod · 0.45
constructorMethod · 0.45
addEventListenerMethod · 0.45
setFunction · 0.45

Calls 1

#parseMethod · 0.95

Tested by

no test coverage detected