]> git.ardis.lu - csvio/commitdiff
Refine types
authorArdis Lu <ardisglu@gmail.com>
Mon, 26 May 2025 05:39:02 +0000 (22:39 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 26 May 2025 05:39:02 +0000 (22:39 -0700)
src/core.js
src/normalization.js

index 6719cf3e78e33f8351d71280ea00479556591bee..b193f4060819ccce020fa5c12cac975e53000c14 100644 (file)
@@ -2,6 +2,7 @@ import { mkdir, open } from 'node:fs/promises';
 import { dirname, basename, normalize } from 'node:path';
 import { fileURLToPath } from 'node:url';
 /** @import { PathLike } from 'node:fs'; */
+/** @import { FileHandle } from 'node:fs/promises'; */
 
 /**
  * Parse and normalize a `PathLike` object into a string.
@@ -394,6 +395,7 @@ export class CSVWriter extends WritableStream {
       rows: 0,
       done: false
     };
+    /** @type FileHandle */
     let handle;
     super({
       async start() {
index a241eb13449ef89334ea87e46a93be79c2226019..135245f8b4f51f6b5e55344d968137e35f2d47b2 100644 (file)
@@ -1,5 +1,5 @@
 // User locale's decimal separator
-const DECIMAL_SEPARATOR = /** @type {Intl.NumberFormatPart!} */(Intl.NumberFormat().formatToParts(.1).find(p => p.type === 'decimal')).value;
+const DECIMAL_SEPARATOR = Intl.NumberFormat().formatToParts(.1).find(p => p.type === 'decimal').value;
 
 /**
  * Convert a string to camelCase.
This page took 0.036193 seconds and 4 git commands to generate.