DieselDepot-APP/node_modules/es-toolkit/dist/compat/util/defaultTo.d.mts
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

22 lines
No EOL
954 B
TypeScript

//#region src/compat/util/defaultTo.d.ts
/**
* Returns the default value for `null`, `undefined`, and `NaN`.
*
* @template T - The type of the value parameter
* @param value - The value to check.
* @param defaultValue - The default value to return if the first value is null, undefined, or NaN.
* @returns Returns either the first value or the default value.
*/
declare function defaultTo<T>(value: T | null | undefined, defaultValue: T): T;
/**
* Returns the default value for `null`, `undefined`, and `NaN`.
*
* @template T - The type of the value parameter
* @template D - The type of the defaultValue parameter
* @param value - The value to check.
* @param defaultValue - The default value to return if the first value is null, undefined, or NaN.
* @returns Returns either the first value or the default value.
*/
declare function defaultTo<T, D>(value: T | null | undefined, defaultValue: D): T | D;
//#endregion
export { defaultTo };