Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

header-field

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

header-field - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

12

index.js

@@ -9,7 +9,13 @@ var hyphenReg = /-[a-z]/g;

if (!str) return "";
str = String(str).toLowerCase();
return (
var result = String(str);
result = (
toUpperCase(str[0]) +
str.slice(1).replace(hyphenReg, toUpperCase)
str
.slice(1)
.toLowerCase()
.replace(hyphenReg, toUpperCase)
);
// Special case to fix the broken http spec.
if (result === "Referrer") result = "Referer";
return result;
}

@@ -16,0 +22,0 @@

{
"name": "header-field",
"version": "0.1.0",
"version": "0.1.1",
"description": "Properly format a header field into a capitalized hyphenated string.",

@@ -5,0 +5,0 @@ "author": "Dylan Piercey <pierceydylan@gmail.com>",

@@ -19,2 +19,5 @@ # Header-Field

field("Content-Disposition"); //-> "Content-Disposition"
// Special case: referrer -> referer.
field("referrer"); //-> "Referer"
```

@@ -21,0 +24,0 @@

@@ -10,3 +10,4 @@ var assert = require("assert");

assert.equal(field("Content-DisPosition"), "Content-Disposition");
assert.equal(field("referrer"), "Referer");
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc