Skip to main content Link Search Menu Expand Document (external link)

Headers overview

Added in v1.0.0


Table of contents


combinators

get

Signature

export declare const get: {
  (key: string): (self: Headers) => Option.Option<string>
  (self: Headers, key: string): Option.Option<string>
}

Added in v1.0.0

has

Signature

export declare const has: { (key: string): (self: Headers) => boolean; (self: Headers, key: string): boolean }

Added in v1.0.0

merge

Signature

export declare const merge: {
  (headers: Headers): (self: Headers) => Headers
  (self: Headers, headers: Headers): Headers
}

Added in v1.0.0

remove

Signature

export declare const remove: { (key: string): (self: Headers) => Headers; (self: Headers, key: string): Headers }

Added in v1.0.0

set

Signature

export declare const set: {
  (key: string, value: string): (self: Headers) => Headers
  (self: Headers, key: string, value: string): Headers
}

Added in v1.0.0

setAll

Signature

export declare const setAll: { (headers: Input): (self: Headers) => Headers; (self: Headers, headers: Input): Headers }

Added in v1.0.0

constructors

empty

Signature

export declare const empty: Headers

Added in v1.0.0

fromInput

Signature

export declare const fromInput: (input?: Input) => Headers

Added in v1.0.0

unsafeFromRecord

Signature

export declare const unsafeFromRecord: (input: ReadonlyRecord.ReadonlyRecord<string, string>) => Headers

Added in v1.0.0

models

Headers (interface)

Signature

export interface Headers {
  readonly [HeadersTypeId]: HeadersTypeId
  readonly [key: string]: string
}

Added in v1.0.0

Input (type alias)

Signature

export type Input =
  | ReadonlyRecord.ReadonlyRecord<string, string | ReadonlyArray<string> | undefined>
  | Iterable<readonly [string, string]>

Added in v1.0.0

refinements

isHeaders

Signature

export declare const isHeaders: (u: unknown) => u is Headers

Added in v1.0.0

schemas

schema

Signature

export declare const schema: Schema.Schema<Headers, ReadonlyRecord.ReadonlyRecord<string, any>>

Added in v1.0.0

schemaFromSelf

Signature

export declare const schemaFromSelf: Schema.Schema<Headers>

Added in v1.0.0

type ids

HeadersTypeId

Signature

export declare const HeadersTypeId: typeof HeadersTypeId

Added in v1.0.0

HeadersTypeId (type alias)

Signature

export type HeadersTypeId = typeof HeadersTypeId

Added in v1.0.0

utils

redact

Signature

export declare const redact: {
  (key: string | ReadonlyArray<string>): (self: Headers) => Record<string, string | Secret.Secret>
  (self: Headers, key: string | ReadonlyArray<string>): Record<string, string | Secret.Secret>
}

Added in v1.0.0