Comparing version 1.4.0 to 1.5.0
@@ -288,2 +288,10 @@ var foldHeaderLine = require('./foldHeaderLine'), | ||
Headers.prototype.toCanonicalObject = function () { | ||
var canonicalObject = {}; | ||
this.getNames().forEach(function (lowerCaseHeaderName) { | ||
canonicalObject[formatHeaderName(lowerCaseHeaderName)] = this.getAll(lowerCaseHeaderName); | ||
}, this); | ||
return canonicalObject; | ||
}; | ||
module.exports = Headers; |
{ | ||
"name": "messy", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "Object model for HTTP and RFC822 messages", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -101,2 +101,9 @@ /*global describe, it*/ | ||
}); | ||
describe('#toCanonicalObject', function () { | ||
expect(new Headers({foo: 'hey', quux: 'baz'}).toCanonicalObject(), 'to equal', { | ||
Foo: ['hey'], | ||
Quux: ['baz'] | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80006
1735