File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * @file Unit Tests - FundingObject
3+ * @module pkg-types/interfaces/tests/FundingObject
4+ */
5+
6+ import type TestSubject from '../funding-object'
7+
8+ describe ( 'unit:interfaces/FundingObject' , ( ) => {
9+ const url : string = 'https://github.com/sponsors/flex-development'
10+
11+ it ( 'should allow object that only has property "url"' , ( ) => {
12+ assertType < TestSubject > ( { url } )
13+ } )
14+
15+ it ( 'should allow object with funding account url and funding type' , ( ) => {
16+ assertType < Required < TestSubject > > ( { type : 'github' , url } )
17+ } )
18+ } )
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Interfaces - FundingObject
3+ * @module pkg-types/interfaces/FundingObject
4+ */
5+
6+ import type { FundingType } from '#src/types'
7+
8+ /**
9+ * Object containing information about how to support a package monetarily.
10+ *
11+ * @see https://docs.npmjs.com/cli/configuring-npm/package-json#funding
12+ */
13+ interface FundingObject {
14+ /**
15+ * Package funding type.
16+ */
17+ type ?: FundingType
18+
19+ /**
20+ * URL to funding account for package.
21+ */
22+ url : string
23+ }
24+
25+ export type { FundingObject as default }
Original file line number Diff line number Diff line change 55
66export type { default as BugsObject } from './bugs-object'
77export type { default as DependencyMeta } from './dependency-meta'
8+ export type { default as FundingObject } from './funding-object'
89export type { default as InstallConfig } from './install-config'
910export type { default as PeerDependencyMeta } from './peer-dependency-meta'
1011export type { default as WorkspacesConfig } from './workspaces-config'
You can’t perform that action at this time.
0 commit comments