Comparing version 0.3.0 to 0.4.0
@@ -43,2 +43,6 @@ function Caseless (dict) { | ||
} | ||
Caseless.prototype.del = function (name) { | ||
var has = this.has(name) | ||
return delete this.dict[has || name] | ||
} | ||
@@ -55,5 +59,5 @@ module.exports = function (dict) {return new Caseless(dict)} | ||
resp.getHeader = function (key) { | ||
return c.getHeader(key) | ||
return c.get(key) | ||
} | ||
return c | ||
} |
{ | ||
"name": "caseless", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Caseless object set/get/has, very useful when working with HTTP headers.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,3 @@ var tape = require('tape') | ||
; | ||
t.plan(9) | ||
t.plan(14) | ||
c.set('a-Header', 'asdf') | ||
@@ -27,2 +27,9 @@ t.equal(c.get('a-header'), 'asdf') | ||
c.set('deleteme', 'foobar') | ||
t.ok(c.has('deleteme')) | ||
t.ok(c.del('deleteme')) | ||
t.notOk(c.has('deleteme')) | ||
t.notOk(c.has('idonotexist')) | ||
t.ok(c.del('idonotexist')) | ||
}) |
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
4212
88