]> git.ardis.lu - csvio/commitdiff
Use PascalCase for type names
authorArdis Lu <ardisglu@gmail.com>
Fri, 10 Jan 2025 07:13:13 +0000 (23:13 -0800)
committerArdis Lu <ardisglu@gmail.com>
Fri, 10 Jan 2025 07:13:13 +0000 (23:13 -0800)
src/core.js
src/normalization.js

index e49389b3a167ca33fed1a1344a25f59cc6ece9af..bf057497e32ecc14467166ea530a68018e647d79 100644 (file)
@@ -104,7 +104,7 @@ export function createCSVReadableStream(path) {
 
 /**
  * Options to configure `createCSVTransformStream`.
- * @typedef {Object} createCSVTransformStreamOptions
+ * @typedef {Object} CreateCSVTransformStreamOptions
  * @property {boolean} [includeHeaders=false] Set to `true` to pass the header row (assumed to be the first row of the CSV) to `fn()`. Otherwise,
  * the header row will flow through to the next stream without going through `fn()`. The default value is `false`.
  * 
@@ -128,7 +128,7 @@ export function createCSVReadableStream(path) {
  * output will be sent the next stream unmodified.
  * 
  * Return `null` to consume an input row without emitting an output row.
- * @param {createCSVTransformStreamOptions} options Object containing flags to configure the stream logic.
+ * @param {CreateCSVTransformStreamOptions} options Object containing flags to configure the stream logic.
  * @returns {TransformStream} A `TransformStream` where each chunk is one row of the CSV file, after transformations applied by `fn()`.
  */
 export function createCSVTransformStream(fn, options = {}) {
index 73828ee22011e328311199885dfaa66ba3cd466c..a64f313bb6dfce468ae229eb8116670b20f3e6c4 100644 (file)
@@ -164,7 +164,7 @@ export function fixExcelDate(str) {
 
 /**
  * Metadata about CSV columns used to normalize raw CSV data.
- * @typedef {Object} createCSVNormalizationStreamHeader
+ * @typedef {Object} CreateCSVNormalizationStreamHeader
  * @property {string} name The name of the CSV column, in camelCase. Values in the header row of the CSV will be
  * transformed to camelCase for comparison purposes and for downstream usage (e.g., a header with the value `Example Column`
  * in the input CSV will match with a `name` value of `exampleColumn`).
@@ -177,7 +177,7 @@ export function fixExcelDate(str) {
 
 /**
  * Options to configure `createCSVNormalizationStream`.
- * @typedef {Object} createCSVNormalizationStreamOptions
+ * @typedef {Object} CreateCSVNormalizationStreamOptions
  * @property {boolean} [passthroughEmptyRows=false] Set to `true` to send empty rows (i.e., rows where all field values are
  * `''`) downstream. Otherwise, empty rows will be removed. The default value is `false`.
  * @property {boolean} [passthroughNumber=false] Set to `true` to NOT apply data casting to `type='number'` columns. Otherwise,
@@ -190,7 +190,7 @@ export function fixExcelDate(str) {
 
 /**
  * The output of `createCSVNormalizationStream`.
- * @typedef {Object} createCSVNormalizationStreamRow
+ * @typedef {Object} CreateCSVNormalizationStreamRow
  * @property {string} name The column name after normalization to camelCase.
  * @property {string} displayName The desired column name in the output CSV.
  * @property {string|number} value The value of the field after attempted data casting. If the original field was empty, this value
@@ -203,9 +203,9 @@ export function fixExcelDate(str) {
  * 
  * Use this function to undo common CSV data mangling caused by spreadsheet programs such as Excel and perform other common 
  * cleanup such as renaming headers and removing empty rows.
- * @param {Array<createCSVNormalizationStreamHeader>} headers An array of metadata objects to configure the data casting and
+ * @param {Array<CreateCSVNormalizationStreamHeader>} headers An array of metadata objects to configure the data casting and
  * cleanup transformations.
- * @param {createCSVNormalizationStreamOptions} options Object containing flags to configure the stream logic. 
+ * @param {CreateCSVNormalizationStreamOptions} options Object containing flags to configure the stream logic. 
  * @returns {TransformStream} A `TransformStream` where each chunk is one row of the CSV file after normalization, represented
  * as a JSON string of a `createCSVNormalizationStreamRow` object.
  */
This page took 0.047473 seconds and 4 git commands to generate.