Skip to content

Commit

Permalink
feat: Index
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Mar 13, 2024
1 parent 6e5d411 commit d92dd68
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/__tests__/index-number.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @file Type Tests - Index
* @module unist-util-types/tests/unit-d/Index
*/

import type TestSubject from '../index-number'

describe('unit-d:Index', () => {
it('should equal number', () => {
expectTypeOf<TestSubject>().toEqualTypeOf<number>()
})
})
14 changes: 14 additions & 0 deletions src/index-number.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @file Index
* @module unist-util-types/Index
*/

/**
* Number of preceding [*siblings*][1] of a [*child*][2] node.
*
* [1]: https://github.com/syntax-tree/unist#sibling
* [2]: https://github.com/syntax-tree/unist#child
*/
type Index = number

export type { Index as default }
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type { default as Children } from './children'
export type { default as Decrement } from './decrement'
export type { default as InclusiveDescendant } from './descendant-inclusive'
export type { default as Increment } from './increment'
export type { default as Index } from './index-number'
export type { default as IsAncestor } from './is-ancestor'
export type { default as IsParent } from './is-parent'
export type { default as Parents } from './parents'
Expand Down

0 comments on commit d92dd68

Please sign in to comment.