Skip to content

Commit

Permalink
docs: Add some TypeDoc documentation
Browse files Browse the repository at this point in the history
Added TypeDoc documentation to the `defaultLsOptions` object and the `resolveOptions` (internal) function.
  • Loading branch information
mitsuki31 committed Apr 26, 2024
1 parent 2ba4a20 commit 968401c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lsfnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ import type {

type Unpack<A> = 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,
Expand Down Expand Up @@ -122,6 +129,17 @@ function checkType<N extends null | undefined>(
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 <ReturnType<(typeof resolveOptions)>> (!options ? defaultLsOptions : {
encoding: options?.encoding || defaultLsOptions.encoding,
Expand Down

0 comments on commit 968401c

Please sign in to comment.