Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/actionify/src/deps/types.ts>PascalCasedPropertiesDeep

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
type alias PascalCasedPropertiesDeep
import { type PascalCasedPropertiesDeep } from "https://deno.land/x/actionify@0.3.0/src/deps/types.ts";

Convert object properties to pascal case recursively.

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

Examples

Example 1

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

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

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

const result: PascalCasedPropertiesDeep<UserWithFriends> = {
	UserInfo: {
		UserId: 1,
		UserName: 'Tom',
	},
	UserFriends: [
		{
			UserId: 2,
			UserName: 'Jerry',
		},
		{
			UserId: 3,
			UserName: 'Spike',
		},
	],
};
definition: Value extends Function | Date | RegExp ? Value : Value extends Array<infer U> ? Array<PascalCasedPropertiesDeep<U>> : Value extends Set<infer U> ? Set<PascalCasedPropertiesDeep<U>> : [K in keyof Valuein keyof PascalCase<K>]: PascalCasedPropertiesDeep<Value[K]>