UNPKG

@prisma/language-server

Version:
14 lines (13 loc) 343 B
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 }