deep-case-crafter
Version:
Transforms deeply nested object, array, Map, and Set keys between common case formats while preserving TypeScript type safety
19 lines (18 loc) • 896 B
TypeScript
import { TransformOptionsInternal } from '../types/transformOptionTypes';
import { TransformMapReturn } from '../types/transformTypes';
/**
* Transforms string keys in a Map (single level only)
*
* @param map - The Map to transform
* @param options - Transformation options including targetCase (required), optional sourceCase and optional preserveSpecialCharacters
* @returns A new Map with transformed keys
*
* @remarks
* - Only string keys are transformed; other key types remain unchanged
* - Values are not transformed, only copied to the new Map
* - When sourceCase is specified, provides precise type transformations
* - This function does not transform nested structures
*
* @internal This function is for internal use by the library
*/
export default function transformMap<K, V, O extends TransformOptionsInternal>(map: Map<K, V>, options: O): TransformMapReturn<K, V, O>;