-
-
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.
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
14b136b
commit 4ce8664
Showing
3 changed files
with
38 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,17 @@ | ||
/** | ||
* @file Type Tests - PositionalInfo | ||
* @module unist-util-types/tests/unit-d/PositionalInfo | ||
*/ | ||
|
||
import type * as mdast from 'mdast' | ||
import type TestSubject from '../positional-info' | ||
|
||
describe('unit-d:PositionalInfo', () => { | ||
it('should equal Pick<T, "position">', () => { | ||
// Arrange | ||
type T = mdast.Code | ||
|
||
// Expect | ||
expectTypeOf<TestSubject<T>>().toEqualTypeOf<Pick<T, 'position'>>() | ||
}) | ||
}) |
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 PositionalInfo | ||
* @module unist-util-types/PositionalInfo | ||
*/ | ||
|
||
import type { Node } from 'unist' | ||
|
||
/** | ||
* Object containing the [*positional information*][1] of [node][2] `T`. | ||
* | ||
* [1]: https://github.com/syntax-tree/unist#positional-information | ||
* [2]: https://github.com/syntax-tree/unist#node | ||
* | ||
* @see {@linkcode Node} | ||
* | ||
* @template {Node} [T=Node] - Node to get positional information from | ||
*/ | ||
type PositionalInfo<T extends Node = Node> = Pick<T, 'position'> | ||
|
||
export type { PositionalInfo as default } |