added doga

This commit is contained in:
szabomarton
2025-02-25 09:55:29 +01:00
parent 5174ab4cc4
commit 13254e5623
1149 changed files with 80161 additions and 0 deletions

15
25_02_24/node_modules/@tinyhttp/res/dist/append.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
import { getResponseHeader, setHeader } from './headers.js';
export const append = (res) => (field, value) => {
const prevVal = getResponseHeader(res)(field);
let newVal = value;
if (prevVal && typeof newVal !== 'number' && typeof prevVal !== 'number') {
newVal = Array.isArray(prevVal)
? prevVal.concat(newVal)
: Array.isArray(newVal)
? [prevVal].concat(newVal)
: [prevVal, newVal];
}
setHeader(res)(field, newVal);
return res;
};
//# sourceMappingURL=append.js.map