Skip to content

Commit 9be7e97

Browse files
committed
feat(interfaces): Person
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent a530f4f commit 9be7e97

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @file Unit Tests - Person
3+
* @module pkg-types/interfaces/tests/Person
4+
*/
5+
6+
import pkg from '../../../package.json' assert { type: 'json' }
7+
import type TestSubject from '../person'
8+
9+
describe('unit:interfaces/Person', () => {
10+
it('should allow object that only has property "name"', () => {
11+
assertType<TestSubject>({ name: pkg.author.name })
12+
})
13+
14+
it('should allow object with all properties', () => {
15+
assertType<Required<TestSubject>>({
16+
...pkg.author,
17+
email: 'unicornware@flexdevelopment.llc'
18+
})
19+
})
20+
})

src/interfaces/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ export type { default as FundingObject } from './funding-object'
99
export type { default as InstallConfig } from './install-config'
1010
export type { default as LicenseObject } from './license-object'
1111
export type { default as PeerDependencyMeta } from './peer-dependency-meta'
12+
export type { default as Person } from './person'
1213
export type { default as PublishConfig } from './publish-config'
1314
export type { default as WorkspacesConfig } from './workspaces-config'

src/interfaces/person.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @file Interfaces - Person
3+
* @module pkg-types/interfaces/Person
4+
*/
5+
6+
/**
7+
* Someone who has been involved in creating or maintaining a package.
8+
*/
9+
interface Person {
10+
/**
11+
* Person's email address.
12+
*/
13+
email?: string
14+
15+
/**
16+
* Person's name.
17+
*/
18+
name: string
19+
20+
/**
21+
* Person's URL.
22+
*/
23+
url?: string
24+
}
25+
26+
export type { Person as default }

0 commit comments

Comments
 (0)