Skip to content

Commit 6a9fcae

Browse files
committed
fix(interfaces): [Point] ensure offset is a number
Signed-off-by: Lexus Drumgold <[email protected]>
1 parent c9db65a commit 6a9fcae

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/interfaces/__tests__/point.spec-d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ describe('unit-d:interfaces/Point', () => {
1010
it('should extend Required<unist.Point>', () => {
1111
expectTypeOf<TestSubject>().toMatchTypeOf<Required<unist.Point>>()
1212
})
13+
14+
it('should match [offset: number]', () => {
15+
expectTypeOf<TestSubject>().toHaveProperty('offset').toBeNumber()
16+
})
1317
})

src/interfaces/point.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ import type unist from 'unist'
1414
*
1515
* @extends {Required<unist.Point>}
1616
*/
17-
interface Point extends Required<unist.Point> {}
17+
interface Point extends Required<unist.Point> {
18+
/**
19+
* Index of character in a source file (0-indexed integer).
20+
*/
21+
offset: number
22+
}
1823

1924
export type { Point as default }

0 commit comments

Comments
 (0)