Skip to content

Commit f45a4f3

Browse files
committed
refactoring: move utility types in utils.
1 parent 6806499 commit f45a4f3

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/api/builder.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { CodegenLogger, createLogger } from "../utils/codegen-logger";
1919
import type { FileBasedMustacheGeneratorOptions } from "./writer-generator/mustache";
2020
import * as Mustache from "./writer-generator/mustache";
2121
import { TypeScript, type TypeScriptOptions } from "./writer-generator/typescript";
22-
import type { FileSystemWriter, FileSystemWriterOptions, WriterOptions } from "./writer-generator/writer";
22+
import type { FileSystemWriter, FileSystemWriterOptions, PartialBy, WriterOptions } from "./writer-generator/writer";
2323

2424
/**
2525
* Configuration options for the API builder
@@ -98,8 +98,6 @@ const normalizeFileName = (str: string): string => {
9898
return res;
9999
};
100100

101-
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
102-
103101
type APIBuilderConfig = PartialBy<
104102
Required<APIBuilderOptions>,
105103
"logger" | "typeSchemaConfig" | "typeSchemaOutputDir" | "exportTypeTree" | "treeShake"

src/api/mustache/generator/ViewModelFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import type {
1010
ViewModel,
1111
} from "@mustache/types";
1212
import { PRIMITIVE_TYPES } from "@mustache/types";
13-
import type { IsPrefixed } from "@mustache/UtilityTypes";
1413
import type { TypeSchemaIndex } from "@root/typeschema/utils";
14+
import type { IsPrefixed } from "@root/utils/types";
1515
import {
1616
type Field,
1717
type Identifier,

src/api/mustache/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { IsPrefixed } from "@mustache/UtilityTypes";
1+
import type { IsPrefixed } from "@root/utils/types";
22
import type { Field, NestedType, TypeSchema } from "@typeschema/types";
33

44
export type DebugMixin = {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
export type CapitalizeFirst<S extends string> = S extends `${infer F}${infer R}` ? `${Uppercase<F>}${R}` : S;
22

33
export type IsPrefixed<T extends string> = `is${CapitalizeFirst<T>}`;
4+
5+
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;

0 commit comments

Comments
 (0)