@prisma/language-server
Version:
Prisma Language Server
14 lines (13 loc) • 343 B
text/typescript
export function getFieldType(line: string): string | undefined {
const wordsInLine: string[] = line.split(/\s+/)
if (wordsInLine.length < 2) {
return undefined
}
// Field type is in second position
// myfield String
const fieldType = wordsInLine[1]
if (fieldType.length !== 0) {
return fieldType
}
return undefined
}