summaryrefslogtreecommitdiff
path: root/std/encoding/csv.ts
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2020-04-28 17:26:31 -0400
committerGitHub <noreply@github.com>2020-04-28 23:26:31 +0200
commit6fd754fba06ab3e3c4447fe118e780aa5040a419 (patch)
tree89a427b9c68e394e548dc5e027737a6c7ae37cb2 /std/encoding/csv.ts
parent1b6181e434422d3fe5aa49f59f1e7adc4ec4ce8f (diff)
Move the docs like `@param [obj.prop]` to the interface. (#4974)
Diffstat (limited to 'std/encoding/csv.ts')
-rw-r--r--std/encoding/csv.ts28
1 files changed, 14 insertions, 14 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,