-
-
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.
feat(interfaces):
PeerDependencyMeta
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
39df145
commit 78a4cbd
Showing
3 changed files
with
37 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,16 @@ | ||
/** | ||
* @file Unit Tests - PeerDependencyMeta | ||
* @module pkg-types/interfaces/tests/PeerDependencyMeta | ||
*/ | ||
|
||
import type TestSubject from '../peer-dependency-meta' | ||
|
||
describe('unit:interfaces/PeerDependencyMeta', () => { | ||
it('should allow empty object', () => { | ||
assertType<TestSubject>({}) | ||
}) | ||
|
||
it('should allow object with peer dependency metadat', () => { | ||
assertType<TestSubject>({ optional: false }) | ||
}) | ||
}) |
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,20 @@ | ||
/** | ||
* @file Interfaces - PeerDependencyMeta | ||
* @module pkg-types/interfaces/PeerDependencyMeta | ||
*/ | ||
|
||
/** | ||
* Peer dependency metadata. | ||
* | ||
* @see https://yarnpkg.com/configuration/manifest#peerDependenciesMeta | ||
*/ | ||
interface PeerDependencyMeta { | ||
/** | ||
* Have package manager mark dependency as optional. | ||
* | ||
* A package consumer omitting the dependency will not raise an error. | ||
*/ | ||
optional?: boolean | ||
} | ||
|
||
export type { PeerDependencyMeta as default } |