diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-08 23:07:41 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-08 23:07:41 +0530 |
| commit | 580ef150778326262d04018460f672bda53d5696 (patch) | |
| tree | 53b93a2e381e6c15ed4e959f766fc88afc234a0f /src/context.ts | |
| parent | a41d70afe7692e4ef344bc3c599115009f2dad15 (diff) | |
| download | ts-types-lang-580ef150778326262d04018460f672bda53d5696.tar.gz ts-types-lang-580ef150778326262d04018460f672bda53d5696.zip | |
chore: adds prettier
Diffstat (limited to 'src/context.ts')
| -rw-r--r-- | src/context.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/context.ts b/src/context.ts index 35fa1ae..7759215 100644 --- a/src/context.ts +++ b/src/context.ts @@ -1,7 +1,7 @@ import { Project, ScriptTarget, Type, Node, SyntaxKind } from 'ts-morph' import path from 'path' -import { v4 as uuid } from 'uuid'; -import { Ctx } from './types'; +import { v4 as uuid } from 'uuid' +import { Ctx } from './types' const RESULT_TYPE_NAME = '__$result' @@ -31,9 +31,12 @@ export const createContext = (): Ctx => { const typeToString = (ty: Type | undefined): string => ty ? typeChecker.compilerObject.typeToString(ty.compilerType) : '' - const [resultTypeNode] = sourceFile.addStatements(`type ${RESULT_TYPE_NAME} = {}`) + const [resultTypeNode] = sourceFile.addStatements( + `type ${RESULT_TYPE_NAME} = {}` + ) - const getResultExpr = (resultKey?: string) => `${RESULT_TYPE_NAME}[${JSON.stringify(resultKey)}` + const getResultExpr = (resultKey?: string) => + `${RESULT_TYPE_NAME}[${JSON.stringify(resultKey)}` const addResult = (name: string, ty: string): Node | undefined => resultTypeNode @@ -77,4 +80,3 @@ export const createContext = (): Ctx => { hasCustomEffect: (name) => customEffects[name] !== undefined, } } - |
