(data)
| 252 | } |
| 253 | |
| 254 | function generateKeyValues (data) { |
| 255 | const keys = Object.keys(data) |
| 256 | const result = [] |
| 257 | for (let i = 0; i < keys.length; ++i) { |
| 258 | const key = keys[i] |
| 259 | const value = data[key] |
| 260 | const name = Buffer.from(`${key}`) |
| 261 | if (Array.isArray(value)) { |
| 262 | for (let j = 0; j < value.length; ++j) { |
| 263 | result.push(name, Buffer.from(`${value[j]}`)) |
| 264 | } |
| 265 | } else { |
| 266 | result.push(name, Buffer.from(`${value}`)) |
| 267 | } |
| 268 | } |
| 269 | return result |
| 270 | } |
| 271 | |
| 272 | /** |
| 273 | * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status |
no test coverage detected