Closed muescha closed 4 years ago
Ah yeah, thanks. Reason is that we didn’t have a term to differentiate between the two when this project was created..
PR welcome to a) fix the docs, b) add a toPoint
function and alias toPosition
to it? Next major we could remove toPosition
.
declare namespace vfileLocation {
type Position = Pick<Point, 'line' | 'column'>
//...
toOffset: (position: Position) => Offset
any hint how this would be changed?
For a) do nothing. For b)
declare namespace vfileLocation {
type Point = Pick<unist.Point, 'line' | 'column'>
/** @deprecated */
type Position = Point
//...
toOffset: (position: Point) => Offset
@muescha What do you think, are you interesting and able to work on a PR?
it was out of my scope - i will give it a try
the readme is confusing.
the function expect an
unist.Point
instead ofunist.Position
there should be this notation change for readme:
Position
toPoint
PS: i think the refactor the function name
toPosition
totoPoint
would be harder