Skip to content

Commit

Permalink
fix dep cycle for CSharp
Browse files Browse the repository at this point in the history
  • Loading branch information
inferrinizzard committed May 5, 2024
1 parent a22b393 commit 0bec808
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
11 changes: 9 additions & 2 deletions packages/quicktype-core/src/language/CSharp/CSharpRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ import { followTargetType } from "../../Transformers";
import { type ClassProperty, type ClassType, type EnumType, type Type, type UnionType } from "../../Type";
import { directlyReachableSingleNamedType, matchType, nullableFromUnion, removeNullFromUnion } from "../../TypeUtils";

import { AccessModifier, type cSharpOptions } from "./language";
import { csTypeForTransformedStringType, isValueType, namingFunction, namingFunctionKeep, noFollow } from "./utils";
import { type cSharpOptions } from "./language";
import {
AccessModifier,
csTypeForTransformedStringType,
isValueType,
namingFunction,
namingFunctionKeep,
noFollow
} from "./utils";

export class CSharpRenderer extends ConvenienceRenderer {
public constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import { ArrayType, type ClassProperty, ClassType, EnumType, type Type, UnionTyp
import { nullableFromUnion } from "../../TypeUtils";

import { CSharpRenderer } from "./CSharpRenderer";
import { AccessModifier, type newtonsoftCSharpOptions } from "./language";
import { type newtonsoftCSharpOptions } from "./language";
import {
AccessModifier,
alwaysApplyTransformation,
denseJsonPropertyName,
denseNullValueHandlingEnumName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import { ArrayType, type ClassProperty, ClassType, EnumType, type Type, UnionTyp
import { nullableFromUnion } from "../../TypeUtils";

import { CSharpRenderer } from "./CSharpRenderer";
import { AccessModifier, type systemTextJsonCSharpOptions } from "./language";
import { type systemTextJsonCSharpOptions } from "./language";
import {
AccessModifier,
alwaysApplyTransformation,
denseJsonPropertyName,
denseNullValueHandlingEnumName,
Expand Down
6 changes: 0 additions & 6 deletions packages/quicktype-core/src/language/CSharp/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ export interface OutputFeatures {
helpers: boolean;
}

export enum AccessModifier {
None = "None",
Public = "Public",
Internal = "Internal"
}

export type CSharpTypeForAny = "object" | "dynamic";

export const cSharpOptions = {
Expand Down
6 changes: 6 additions & 0 deletions packages/quicktype-core/src/language/CSharp/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ import { nullableFromUnion } from "../../TypeUtils";

import { keywords } from "./constants";

export enum AccessModifier {
None = "None",
Public = "Public",
Internal = "Internal"
}

export function noFollow(t: Type): Type {
return t;
}
Expand Down

0 comments on commit 0bec808

Please sign in to comment.