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

28 lines
415 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);
}
}
module.exports = Headers;