Skip to content

Commit

Permalink
docs: update jsdoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Jan 7, 2017
1 parent c4a18e0 commit b8cac01
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,37 @@

/**
* Module exports.
* @public
*/

module.exports = contentDisposition
module.exports.parse = parse

/**
* Module dependencies.
* @private
*/

var basename = require('path').basename

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

var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex

/**
* RegExp to match percent encoding escape.
* @private
*/

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

/**
* RegExp to match non-latin1 characters.
* @private
*/

var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g
Expand All @@ -43,12 +48,14 @@ var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g
*
* quoted-pair = "\" CHAR
* CHAR = <any US-ASCII character (octets 0 - 127)>
* @private
*/

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

/**
* RegExp to match chars that must be quoted-pair in RFC 2616
* @private
*/

var QUOTE_REGEXP = /([\\"])/g
Expand All @@ -75,6 +82,7 @@ var QUOTE_REGEXP = /([\\"])/g
* 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
*/

var PARAM_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 // eslint-disable-line no-control-regex
Expand All @@ -100,6 +108,7 @@ var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/
* attr-char = ALPHA / DIGIT
* / "!" / "#" / "$" / "&" / "+" / "-" / "."
* / "^" / "_" / "`" / "|" / "~"
* @private
*/

var EXT_VALUE_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!#$&+.^_`|~-])+)$/
Expand All @@ -115,6 +124,7 @@ var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-
* disp-ext-parm = token "=" value
* | ext-token "=" ext-value
* ext-token = <the characters in token, followed by "*">
* @private
*/

var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex
Expand All @@ -127,7 +137,7 @@ var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/
* @param {string} [options.type=attachment]
* @param {string|boolean} [options.fallback=true]
* @return {string}
* @api public
* @public
*/

function contentDisposition (filename, options) {
Expand All @@ -149,7 +159,7 @@ function contentDisposition (filename, options) {
* @param {string} [filename]
* @param {string|boolean} [fallback=true]
* @return {object}
* @api private
* @private
*/

function createparams (filename, fallback) {
Expand Down Expand Up @@ -210,7 +220,7 @@ function createparams (filename, fallback) {
* @param {string} obj.type
* @param {object} [obj.parameters]
* @return {string}
* @api private
* @private
*/

function format (obj) {
Expand Down Expand Up @@ -248,7 +258,7 @@ function format (obj) {
*
* @param {string} str
* @return {string}
* @api private
* @private
*/

function decodefield (str) {
Expand Down Expand Up @@ -284,7 +294,7 @@ function decodefield (str) {
*
* @param {string} val
* @return {string}
* @api private
* @private
*/

function getlatin1 (val) {
Expand All @@ -297,7 +307,7 @@ function getlatin1 (val) {
*
* @param {string} string
* @return {object}
* @api private
* @public
*/

function parse (string) {
Expand Down Expand Up @@ -378,7 +388,7 @@ function parse (string) {
* @param {string} str
* @param {string} hex
* @return {string}
* @api private
* @private
*/

function pdecode (str, hex) {
Expand All @@ -390,7 +400,7 @@ function pdecode (str, hex) {
*
* @param {string} char
* @return {string}
* @api private
* @private
*/

function pencode (char) {
Expand All @@ -405,7 +415,7 @@ function pencode (char) {
*
* @param {string} val
* @return {string}
* @api private
* @private
*/

function qstring (val) {
Expand All @@ -419,7 +429,7 @@ function qstring (val) {
*
* @param {string} val
* @return {string}
* @api private
* @private
*/

function ustring (val) {
Expand All @@ -434,6 +444,7 @@ function ustring (val) {

/**
* Class for parsed Content-Disposition header for v8 optimization
* @public
*/

function ContentDisposition (type, parameters) {
Expand Down

0 comments on commit b8cac01

Please sign in to comment.