This repository has been archived on 2023-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
node-fetch-cache/classes/headers.js

32 lines
458 B
JavaScript
Raw Normal View History

2020-11-28 04:28:00 +00:00
class Headers {
constructor(rawHeaders) {
this.rawHeaders = rawHeaders;
}
entries() {
return Object.entries(this.rawHeaders);
}
keys() {
return Object.keys(this.rawHeaders);
}
values() {
return Object.values(this.rawHeaders);
}
get(name) {
return this.rawHeaders[name.toLowerCase()] || null;
}
has(name) {
return !!this.get(name);
}
2020-11-28 16:02:55 +00:00
raw() {
return this.rawHeaders;
}
2020-11-28 04:28:00 +00:00
}
module.exports = Headers;