-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
8166f6f
commit ec81ecd
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @file Unit Tests - LicenseObject | ||
* @module pkg-types/interfaces/tests/LicenseObject | ||
*/ | ||
|
||
import type TestSubject from '../license-object' | ||
|
||
describe('unit:interfaces/LicenseObject', () => { | ||
const url: string = 'https://www.opensource.org/licenses/mit-license.php' | ||
|
||
it('should allow empty object', () => { | ||
assertType<TestSubject>({}) | ||
}) | ||
|
||
it('should allow object that only has property "url"', () => { | ||
assertType<TestSubject>({ url }) | ||
}) | ||
|
||
it('should allow object with all properties', () => { | ||
assertType<Required<TestSubject>>({ type: 'MIT', url }) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* @file Interfaces - LicenseObject | ||
* @module pkg-types/interfaces/LicenseObject | ||
*/ | ||
|
||
/** | ||
* Object representing a package license. | ||
* | ||
* @see https://docs.npmjs.com/cli/v9/configuring-npm/package-json#license | ||
*/ | ||
interface LicenseObject { | ||
/** | ||
* License type. | ||
*/ | ||
type?: string | ||
|
||
/** | ||
* License URL. | ||
*/ | ||
url?: string | ||
} | ||
|
||
export type { LicenseObject as default } |