UNPKG

pluto-http-client

Version:

HTTP client for NodeJS. Inspired in the Java JAX-RS spec so you can expect excellence, versatility and extensibility.

33 lines (32 loc) 823 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Header = void 0; const node_http_1 = require("node:http"); class Header { constructor(key, value) { (0, node_http_1.validateHeaderName)(key); (0, node_http_1.validateHeaderValue)(key, value); this._key = key; this._value = value; } get key() { return this._key; } get value() { return this._value; } clone() { return new Header(this.key, this.value); } equals(other) { if (other instanceof Header) { return this.key.toLowerCase() === other.key.toLowerCase() && this.value === other.value; } return false; } id() { return this.key.toLowerCase(); } } exports.Header = Header;