Skip to main content
Module

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

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

Convert object properties to delimiter case but not recursively.

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

Examples

Example 1

import type {DelimiterCasedProperties} from 'type-fest';

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

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

Type Parameters

Value
Delimiter extends string
definition: Value extends Function ? Value : Value extends Array<infer U> ? Value : [K in keyof Valuein keyof DelimiterCase<K, Delimiter>]: Value[K]