Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "utils/contentDisposition"

Index

Variables

Private Const DISPOSITION_TYPE_REGEXP

DISPOSITION_TYPE_REGEXP: RegExp = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/

RegExp for constious RFC 6266 grammar

disposition-type = "inline" | "attachment" | disp-ext-type disp-ext-type = token disposition-parm = filename-parm | disp-ext-parm filename-parm = "filename" "=" value | "filename*" "=" ext-value disp-ext-parm = token "=" value | ext-token "=" ext-value ext-token = <the characters in token, followed by "*">

Private Const ENCODE_URL_ATTR_CHAR_REGEXP

ENCODE_URL_ATTR_CHAR_REGEXP: RegExp = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g

RegExp to match non attr-char, after encodeURIComponent (i.e. not including "%")

Private Const EXT_VALUE_REGEXP

EXT_VALUE_REGEXP: RegExp = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/

RegExp for constious RFC 5987 grammar

ext-value = charset "'" [ language ] "'" value-chars charset = "UTF-8" / "ISO-8859-1" / mime-charset mime-charset = 1*mime-charsetc mime-charsetc = ALPHA / DIGIT / "!" / "#" / "$" / "%" / "&" / "+" / "-" / "^" / "_" / "" / "{" / "}" / "~" language = ( 2*3ALPHA [ extlang ] ) / 4ALPHA / 5*8ALPHA extlang = *3( "-" 3ALPHA ) value-chars = *( pct-encoded / attr-char ) pct-encoded = "%" HEXDIG HEXDIG attr-char = ALPHA / DIGIT / "!" / "#" / "$" / "&" / "+" / "-" / "." / "^" / "_" / "" / "|" / "~"

Private Const HEX_ESCAPE_REGEXP

HEX_ESCAPE_REGEXP: RegExp = /%[0-9A-Fa-f]{2}/

RegExp to match percent encoding escape.

Const HEX_ESCAPE_REPLACE_REGEXP

HEX_ESCAPE_REPLACE_REGEXP: RegExp = /%([0-9A-Fa-f]{2})/g

Private Const NON_LATIN1_REGEXP

NON_LATIN1_REGEXP: RegExp = /[^\x20-\x7e\xa0-\xff]/g

RegExp to match non-latin1 characters.

Private Const PARAM_REGEXP

PARAM_REGEXP: RegExp = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g

RegExp for constious RFC 2616 grammar

parameter = token "=" ( token | quoted-string ) token = 1* separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT quoted-string = ( <"> (qdtext | quoted-pair ) <"> ) qdtext = <any TEXT except <">> quoted-pair = "" CHAR CHAR = <any US-ASCII character (octets 0 - 127)> TEXT = <any OCTET except CTLs, but including LWS> LWS = [CRLF] 1( SP | HT ) CRLF = CR LF CR = <US-ASCII CR, carriage return (13)> LF = <US-ASCII LF, linefeed (10)> SP = <US-ASCII SP, space (32)> HT = <US-ASCII HT, horizontal-tab (9)> CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)> OCTET = <any 8-bit sequence of data>

Private Const QESC_REGEXP

QESC_REGEXP: RegExp = /\\([\u0000-\u007f])/g

RegExp to match quoted-pair in RFC 2616

quoted-pair = "" CHAR CHAR = <any US-ASCII character (octets 0 - 127)>

Private Const QUOTE_REGEXP

QUOTE_REGEXP: RegExp = /([\\"])/g

RegExp to match chars that must be quoted-pair in RFC 2616

Const TEXT_REGEXP

TEXT_REGEXP: RegExp = /^[\x20-\x7e\x80-\xff]+$/

Const TOKEN_REGEXP

TOKEN_REGEXP: RegExp = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/

Functions

Const contentDisposition

  • contentDisposition(type: string, filename?: string): string

Private createParams

  • createParams(filename?: string): any

Private format

  • format(__namedParameters: { parameters: any; type: string }): string

Private getLatin1

  • getLatin1(val: any): string

Private pencode

  • pencode(char: any): string

Private qString

  • qString(val: any): string

Private uString

  • uString(val: any): string

Generated using TypeDoc