Type Alias KebabCasedProperties<Value>

KebabCasedProperties: DelimiterCasedProperties<Value, "-">

Convert object properties to kebab case but not recursively.

This can be useful when, for example, converting some API types from a different style.

Type Parameters

  • Value
  • KebabCase
  • KebabCasedPropertiesDeep
import type {KebabCasedProperties} from 'type-fest';

interface User {
userId: number;
userName: string;
}

const result: KebabCasedProperties<User> = {
'user-id': 1,
'user-name': 'Tom',
};