UNPKG

mach

Version:
39 lines (31 loc) 1.05 kB
"use strict"; var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var normalizeHeaderName = require("./utils/normalizeHeaderName"); var Header = (function () { function Header(name, value) { _classCallCheck(this, Header); this.name = name; this.value = value; } _prototypeProperties(Header, null, { name: { get: function () { return this._name; }, set: function (value) { this._name = normalizeHeaderName(value); }, configurable: true }, toString: { value: function toString() { return this.name + ": " + this.value; }, writable: true, configurable: true } }); return Header; })(); module.exports = Header;