-
-
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.
refactor: unist-util-types integration
- https://github.com/flex-development/unist-util-types Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
0c95017
commit 80a80bd
Showing
15 changed files
with
116 additions
and
123 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 was deleted.
Oops, something went wrong.
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 esast/types/tests/unit-d/AnyNode | ||
*/ | ||
|
||
import type { Root } from '@flex-development/esast' | ||
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 esast/types/tests/unit-d/AnyParent | ||
*/ | ||
|
||
import type { Root } from '@flex-development/esast' | ||
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 esast/types/tests/unit-d/Child | ||
*/ | ||
|
||
import type { AnyParent } from '@flex-development/esast' | ||
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 Definitions - AnyNode | ||
* @module esast/types/AnyNode | ||
*/ | ||
|
||
import type { Root } from '@flex-development/esast' | ||
import type { InclusiveDescendant } from '@flex-development/unist-util-types' | ||
|
||
/** | ||
* Union of nodes that can occur in esast. | ||
*/ | ||
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 Definitions - AnyParent | ||
* @module esast/types/AnyParent | ||
*/ | ||
|
||
import type { Root } from '@flex-development/esast' | ||
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,18 @@ | ||
/** | ||
* @file Type Definitions - Child | ||
* @module esast/types/Child | ||
*/ | ||
|
||
import type { AnyParent } from '@flex-development/esast' | ||
import type { Children } from '@flex-development/unist-util-types' | ||
|
||
/** | ||
* Union of [*child*][1] nodes that are [*inclusive descendants*][2] of | ||
* {@linkcode Root}. | ||
* | ||
* [1]: https://github.com/syntax-tree/unist#child | ||
* [2]: https://github.com/syntax-tree/unist#descendant | ||
*/ | ||
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