mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-08 08:44:37 +08:00
27 lines
602 B
JavaScript
27 lines
602 B
JavaScript
'use strict'
|
|
// undici's FormData: statics that read private instance state, taken off
|
|
// the class before the class is exposed.
|
|
class FormData {
|
|
#state = []
|
|
|
|
append (name, value) {
|
|
this.#state.push({ name, value })
|
|
}
|
|
|
|
static getFormDataState (formData) {
|
|
return formData.#state
|
|
}
|
|
|
|
static setFormDataState (formData, state) {
|
|
formData.#state = state
|
|
}
|
|
|
|
static get boundary () {
|
|
return undefined
|
|
}
|
|
}
|
|
|
|
const { getFormDataState, setFormDataState, boundary = '----formdata-default' } = FormData
|
|
|
|
module.exports = { FormData, getFormDataState, setFormDataState, boundary }
|