From 968401cec68f83ed6f242472e22de7cc37df2f37 Mon Sep 17 00:00:00 2001 From: Ryuu Mitsuki Date: Fri, 26 Apr 2024 23:58:14 +0700 Subject: [PATCH] docs: Add some TypeDoc documentation Added TypeDoc documentation to the `defaultLsOptions` object and the `resolveOptions` (internal) function. --- src/lsfnd.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lsfnd.ts b/src/lsfnd.ts index ce745bb..ca65877 100644 --- a/src/lsfnd.ts +++ b/src/lsfnd.ts @@ -27,6 +27,13 @@ import type { type Unpack = A extends Array<(infer U)> ? U : A; +/** + * An object containing all default values of {@link LsOptions `LsOptions`} type. + * + * @since 1.0.0 + * @see {@link DefaultLsOptions} + * @see {@link LsOptions} + */ export const defaultLsOptions: DefaultLsOptions = { encoding: 'utf8', recursive: false, @@ -122,6 +129,17 @@ function checkType( return; } +/** + * Resolves the given `options` ({@link LsOptions}). + * + * @param options - An object represents the options to be resolved. Set to `null` + * or `undefined` to gets the default options. + * @returns A new object represents the resolved options. Returns the default + * options if the `options` parameter not specified or `null`. + * + * @since 1.0.0 + * @internal + */ function resolveOptions(options: LsOptions | null | undefined): ResolvedLsOptions { return > (!options ? defaultLsOptions : { encoding: options?.encoding || defaultLsOptions.encoding,