source: node_modules/es-toolkit/dist/compat/util/defaultTo.d.mts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 968 bytes
RevLine 
[a762898]1/**
2 * Returns the default value for `null`, `undefined`, and `NaN`.
3 *
4 * @template T - The type of the value parameter
5 * @param {T | null | undefined} value - The value to check.
6 * @param {T} defaultValue - The default value to return if the first value is null, undefined, or NaN.
7 * @returns {T} Returns either the first value or the default value.
8 */
9declare function defaultTo<T>(value: T | null | undefined, defaultValue: T): T;
10/**
11 * Returns the default value for `null`, `undefined`, and `NaN`.
12 *
13 * @template T - The type of the value parameter
14 * @template D - The type of the defaultValue parameter
15 * @param {T | null | undefined} value - The value to check.
16 * @param {D} defaultValue - The default value to return if the first value is null, undefined, or NaN.
17 * @returns {T | D} Returns either the first value or the default value.
18 */
19declare function defaultTo<T, D>(value: T | null | undefined, defaultValue: D): T | D;
20
21export { defaultTo };
Note: See TracBrowser for help on using the repository browser.