DefinitelyTyped/types/parse-full-name/parse-full-name-tests.ts
Nathan Anderson 004c92f2dc
Added types for parse-full-name (#43502)
* added the parse-full-name types

* updated module to not have exported functions and types

* exported the guts of the types as opposed to a single module

* fixed some tests and added a comment for only supporting typescript 3.0

* whoops had a ' that shouldn't have been there

Co-authored-by: n8 <n8@dwell.management>
2020-04-01 13:06:07 -07:00

12 lines
472 B
TypeScript

import { Name, parseFullName } from "parse-full-name";
const parsedName: Name = parseFullName('john doe sr');
parsedName.first; // $ExpectType string | undefined
parsedName.middle; // $ExpectType string | undefined
parsedName.last; // $ExpectType string | undefined
parsedName.nick; // $ExpectType string | undefined
parsedName.suffix; // $ExpectType string | undefined
parsedName.title; // $ExpectType string | undefined
parsedName.error; // $ExpectType [] | undefined