43 lines
870 B
TypeScript
Raw Normal View History

2026-05-31 13:21:13 +02:00
//#region src/compat/function/identity.d.ts
/**
* Returns the input value unchanged.
*
* @template T - The type of the input value.
* @param {T} x - The value to be returned.
* @returns {T} The input value.
*
* @example
* // Returns 5
* identity(5);
*
* @example
* // Returns 'hello'
* identity('hello');
*
* @example
* // Returns { key: 'value' }
* identity({ key: 'value' });
*/
declare function identity<T>(value: T): T;
/**
* Returns the input value unchanged.
*
* @template T - The type of the input value.
* @param {T} x - The value to be returned.
* @returns {T} The input value.
*
* @example
* // Returns 5
* identity(5);
*
* @example
* // Returns 'hello'
* identity('hello');
*
* @example
* // Returns { key: 'value' }
* identity({ key: 'value' });
*/
declare function identity(): undefined;
//#endregion
export { identity };