summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--std/encoding/csv.ts28
-rw-r--r--std/http/cookie.ts22
-rw-r--r--std/path/globrex.ts26
3 files changed, 38 insertions, 38 deletions
diff --git a/std/encoding/csv.ts b/std/encoding/csv.ts
index ae86e25bb..75763f2c6 100644
--- a/std/encoding/csv.ts
+++ b/std/encoding/csv.ts
@@ -264,6 +264,20 @@ export interface HeaderOptions {
export interface ParseOptions extends ReadOptions {
header: boolean | string[] | HeaderOptions[];
+ /** Parse function for rows.
+ * Example:
+ * const r = await parseFile('a,b,c\ne,f,g\n', {
+ * header: ["this", "is", "sparta"],
+ * parse: (e: Record<string, unknown>) => {
+ * return { super: e.this, street: e.is, fighter: e.sparta };
+ * }
+ * });
+ * // output
+ * [
+ * { super: "a", street: "b", fighter: "c" },
+ * { super: "e", street: "f", fighter: "g" }
+ * ]
+ */
parse?: (input: unknown) => unknown;
}
@@ -273,20 +287,6 @@ export interface ParseOptions extends ReadOptions {
* for columns and rows.
* @param input Input to parse. Can be a string or BufReader.
* @param opt options of the parser.
- * @param [opt.header=false] HeaderOptions
- * @param [opt.parse=null] Parse function for rows.
- * Example:
- * const r = await parseFile('a,b,c\ne,f,g\n', {
- * header: ["this", "is", "sparta"],
- * parse: (e: Record<string, unknown>) => {
- * return { super: e.this, street: e.is, fighter: e.sparta };
- * }
- * });
- * // output
- * [
- * { super: "a", street: "b", fighter: "c" },
- * { super: "e", street: "f", fighter: "g" }
- * ]
*/
export async function parse(
input: string | BufReader,
diff --git a/std/http/cookie.ts b/std/http/cookie.ts
index 22ecf3bc7..43cf3f486 100644
--- a/std/http/cookie.ts
+++ b/std/http/cookie.ts
@@ -10,15 +10,26 @@ export interface Cookies {
}
export interface Cookie {
+ /** Name of the cookie. */
name: string;
+ /** Value of the cookie. */
value: string;
+ /** Expiration date of the cookie. */
expires?: Date;
+ /** Max-Age of the Cookie. Must be integer superior to 0. */
maxAge?: number;
+ /** Specifies those hosts to which the cookie will be sent. */
domain?: string;
+ /** Indicates a URL path that must exist in the request. */
path?: string;
+ /** Indicates if the cookie is made using SSL & HTTPS. */
secure?: boolean;
+ /** Indicates that cookie is not accessible via Javascript. **/
httpOnly?: boolean;
+ /** Allows servers to assert that a cookie ought not to
+ * be sent along with cross-site requests. */
sameSite?: SameSite;
+ /** Additional key value pairs with the form "key=value" */
unparsed?: string[];
}
@@ -95,17 +106,6 @@ export function getCookies(req: ServerRequest): Cookies {
* Set the cookie header properly in the Response
* @param res Server Response
* @param cookie Cookie to set
- * @param [cookie.name] Name of the cookie
- * @param [cookie.value] Value of the cookie
- * @param [cookie.expires] Expiration Date of the cookie
- * @param [cookie.maxAge] Max-Age of the Cookie. Must be integer superior to 0
- * @param [cookie.domain] Specifies those hosts to which the cookie will be sent
- * @param [cookie.path] Indicates a URL path that must exist in the request.
- * @param [cookie.secure] Indicates if the cookie is made using SSL & HTTPS.
- * @param [cookie.httpOnly] Indicates that cookie is not accessible via
- * Javascript
- * @param [cookie.sameSite] Allows servers to assert that a cookie ought not to
- * be sent along with cross-site requests
* Example:
*
* setCookie(response, { name: 'deno', value: 'runtime',
diff --git a/std/path/globrex.ts b/std/path/globrex.ts
index 868df797a..3fc69dd6c 100644
--- a/std/path/globrex.ts
+++ b/std/path/globrex.ts
@@ -12,18 +12,23 @@ const GLOBSTAR_SEGMENT = `((?:[^${SEP_ESC}/]*(?:${SEP_ESC}|\/|$))*)`;
const WILDCARD_SEGMENT = `(?:[^${SEP_ESC}/]*)`;
export interface GlobrexOptions {
- // Allow ExtGlob features
+ /** Allow ExtGlob features.
+ * @default false */
extended?: boolean;
- // When globstar is true, '/foo/**' is equivelant
- // to '/foo/*' when globstar is false.
- // Having globstar set to true is the same usage as
- // using wildcards in bash
+ /** Support globstar.
+ * @remarks When globstar is `true`, '/foo/**' is equivelant
+ * to '/foo/*' when globstar is `false`.
+ * Having globstar set to `true` is the same usage as
+ * using wildcards in bash.
+ * @default false */
globstar?: boolean;
- // be laissez faire about mutiple slashes
+ /** Be laissez-faire about mutiple slashes.
+ * @default true */
strict?: boolean;
- // Parse as filepath for extra path related features
+ /** Parse as filepath for extra path related features.
+ * @default false */
filepath?: boolean;
- // Flag to use in the generated RegExp
+ /** Flag to use in the generated RegExp. */
flags?: string;
}
@@ -40,11 +45,6 @@ export interface GlobrexResult {
* Convert any glob pattern to a JavaScript Regexp object
* @param glob Glob pattern to convert
* @param opts Configuration object
- * @param [opts.extended=false] Support advanced ext globbing
- * @param [opts.globstar=false] Support globstar
- * @param [opts.strict=true] be laissez faire about mutiple slashes
- * @param [opts.filepath=""] Parse as filepath for extra path related features
- * @param [opts.flags=""] RegExp globs
* @returns Converted object with string, segments and RegExp object
*/
export function globrex(