-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(types)!:
AnyNode
, AnyParent
, Child
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
d75da6b
commit 0948945
Showing
16 changed files
with
117 additions
and
17 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
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
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
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
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,14 @@ | ||
/** | ||
* @file Type Tests - AnyNode | ||
* @module docast/types/tests/unit-d/AnyNode | ||
*/ | ||
|
||
import type { Root } from '@flex-development/docast' | ||
import type { InclusiveDescendant } from '@flex-development/unist-util-types' | ||
import type TestSubject from '../any-node' | ||
|
||
describe('unit-d:types/AnyNode', () => { | ||
it('should equal InclusiveDescendant<Root>', () => { | ||
expectTypeOf<TestSubject>().toEqualTypeOf<InclusiveDescendant<Root>>() | ||
}) | ||
}) |
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,14 @@ | ||
/** | ||
* @file Type Tests - AnyParent | ||
* @module docast/types/tests/unit-d/AnyParent | ||
*/ | ||
|
||
import type { Root } from '@flex-development/docast' | ||
import type { Parents } from '@flex-development/unist-util-types' | ||
import type TestSubject from '../any-parent' | ||
|
||
describe('unit-d:types/AnyParent', () => { | ||
it('should equal Parents<Root>', () => { | ||
expectTypeOf<TestSubject>().toEqualTypeOf<Parents<Root>>() | ||
}) | ||
}) |
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,14 @@ | ||
/** | ||
* @file Type Tests - Child | ||
* @module docast/types/tests/unit-d/Child | ||
*/ | ||
|
||
import type { AnyParent } from '@flex-development/docast' | ||
import type { Children } from '@flex-development/unist-util-types' | ||
import type TestSubject from '../child' | ||
|
||
describe('unit-d:types/Child', () => { | ||
it('should equal Children<AnyParent>[number]', () => { | ||
expectTypeOf<TestSubject>().toEqualTypeOf<Children<AnyParent>[number]>() | ||
}) | ||
}) |
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,14 @@ | ||
/** | ||
* @file Type Aliases - AnyNode | ||
* @module docast/types/AnyNode | ||
*/ | ||
|
||
import type { Root } from '@flex-development/docast' | ||
import type { InclusiveDescendant } from '@flex-development/unist-util-types' | ||
|
||
/** | ||
* Union of nodes that can occur in docast. | ||
*/ | ||
type AnyNode = InclusiveDescendant<Root> | ||
|
||
export type { AnyNode as default } |
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,18 @@ | ||
/** | ||
* @file Type Aliases - AnyParent | ||
* @module docast/types/AnyParent | ||
*/ | ||
|
||
import type { Root } from '@flex-development/docast' | ||
import type { Parents } from '@flex-development/unist-util-types' | ||
|
||
/** | ||
* Union of [*parents*][1] that are [*inclusive descendants*][2] of | ||
* {@linkcode Root}. | ||
* | ||
* [1]: https://github.com/syntax-tree/unist#parent | ||
* [2]: https://github.com/syntax-tree/unist#descendant | ||
*/ | ||
type AnyParent = Parents<Root> | ||
|
||
export type { AnyParent as default } |
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 Type Aliases - Child | ||
* @module docast/types/Child | ||
*/ | ||
|
||
import type { AnyParent } from '@flex-development/docast' | ||
import type { Children } from '@flex-development/unist-util-types' | ||
|
||
/** | ||
* Union of [*child*][1] nodes. | ||
* | ||
* [1]: https://github.com/syntax-tree/unist#child | ||
*/ | ||
type Child = Children<AnyParent>[number] | ||
|
||
export type { Child as default } |
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