Skip to main content
Module

x/scaffold/src/deps/types.ts>KebabCasedPropertiesDeep

scaffold your next project with style and 💗
Latest
type alias KebabCasedPropertiesDeep
import { type KebabCasedPropertiesDeep } from "https://deno.land/x/scaffold@0.3.0/src/deps/types.ts";

Convert object properties to kebab case recursively.

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

Examples

Example 1

import type [KebabCasedPropertiesDeep] from 'type-fest';

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

interface UserWithFriends {
	userInfo: User;
	userFriends: User[];
}

const result: KebabCasedPropertiesDeep<UserWithFriends> = {
	'user-info': {
		'user-id': 1,
		'user-name': 'Tom',
	},
	'user-friends': [
		{
			'user-id': 2,
			'user-name': 'Jerry',
		},
		{
			'user-id': 3,
			'user-name': 'Spike',
		},
	],
};