From 884652f6ea49a0b3c3d323833c5c6744baa6a80b Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Sun, 25 May 2025 22:39:02 -0700 Subject: [PATCH] Refine types --- src/core.js | 2 ++ src/normalization.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.js b/src/core.js index 6719cf3..b193f40 100644 --- a/src/core.js +++ b/src/core.js @@ -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() { diff --git a/src/normalization.js b/src/normalization.js index a241eb1..135245f 100644 --- a/src/normalization.js +++ b/src/normalization.js @@ -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. -- 2.47.3