Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@types/caseless
Advanced tools
TypeScript definitions for caseless
@types/caseless provides TypeScript type definitions for the 'caseless' npm package, which allows for case-insensitive operations on HTTP headers.
Set a header
This feature allows you to set a header in a case-insensitive manner. The 'set' method ensures that the header name is stored in a consistent case.
const caseless = require('caseless');
const headers = caseless();
headers.set('Content-Type', 'application/json');
Get a header
This feature allows you to retrieve a header value in a case-insensitive manner. The 'get' method will return the value regardless of the case of the input header name.
const caseless = require('caseless');
const headers = caseless();
headers.set('Content-Type', 'application/json');
const contentType = headers.get('content-type');
Check if a header exists
This feature allows you to check if a header exists in a case-insensitive manner. The 'has' method returns a boolean indicating the presence of the header.
const caseless = require('caseless');
const headers = caseless();
headers.set('Content-Type', 'application/json');
const hasContentType = headers.has('content-type');
Delete a header
This feature allows you to delete a header in a case-insensitive manner. The 'del' method removes the header regardless of the case of the input header name.
const caseless = require('caseless');
const headers = caseless();
headers.set('Content-Type', 'application/json');
headers.del('content-type');
The 'http-headers' package provides a similar functionality for managing HTTP headers in a case-insensitive manner. It offers methods to get, set, and delete headers, but it is more focused on parsing and formatting HTTP headers.
The 'header-case-normalizer' package focuses on normalizing the case of HTTP headers. It ensures that headers are stored in a consistent case format, similar to 'caseless', but it does not provide as many utility methods for managing headers.
While 'node-fetch' is primarily a library for making HTTP requests, it includes built-in support for case-insensitive headers. It provides methods to set, get, and delete headers in a case-insensitive manner, similar to 'caseless'.
npm install --save @types/caseless
This package contains type definitions for caseless ( https://github.com/mikeal/caseless ).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/caseless
Additional Details
These definitions were written by downace https://github.com/downace, Matt R. Wilson https://github.com/mastermatt, Emily Klassen https://github.com/forivall.
FAQs
TypeScript definitions for caseless
The npm package @types/caseless receives a total of 4,873,041 weekly downloads. As such, @types/caseless popularity was classified as popular.
We found that @types/caseless demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.