MCPcopy Create free account
hub / github.com/nodejs/node / append

Method append

deps/undici/src/lib/web/fetch/formdata.js:30–56  ·  view source on GitHub ↗
(name, value, filename = undefined)

Source from the content-addressed store, hash-verified

28 }
29
30 append (name, value, filename = undefined) {
31 webidl.brandCheck(this, FormData)
32
33 const prefix = 'FormData.append'
34 webidl.argumentLengthCheck(arguments, 2, prefix)
35
36 name = webidl.converters.USVString(name)
37
38 if (arguments.length === 3 || webidl.is.Blob(value)) {
39 value = webidl.converters.Blob(value, prefix, 'value')
40
41 if (filename !== undefined) {
42 filename = webidl.converters.USVString(filename)
43 }
44 } else {
45 value = webidl.converters.USVString(value)
46 }
47
48 // 1. Let value be value if given; otherwise blobValue.
49
50 // 2. Let entry be the result of creating an entry with
51 // name, value, and filename if given.
52 const entry = makeEntry(name, value, filename)
53
54 // 3. Append entry to this’s entry list.
55 this.#state.push(entry)
56 }
57
58 delete (name) {
59 webidl.brandCheck(this, FormData)

Callers 3

formDataFunction · 0.95
formDataFunction · 0.95

Calls 5

brandCheckMethod · 0.80
argumentLengthCheckMethod · 0.80
USVStringMethod · 0.80
makeEntryFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected