vfile-location:在位置(基于行和列)位置和偏移(基于范围)位置之间进行转换的实用程序

时间:2021-05-12 02:43:02
【文件属性】:
文件名称:vfile-location:在位置(基于行和列)位置和偏移(基于范围)位置之间进行转换的实用程序
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-12 02:43:02
location position file virtual vfile vfile位置 在位置(基于行和列)和偏移量(基于范围)之间转换。 安装 该软件包 :需要使用Node 12+才能使用它,并且必须将其import而不是require d。 : npm install vfile-location 用 import { VFile } from 'vfile' import { location } from 'vfile-location' var place = location ( new VFile ( 'foo\nbar\nbaz' ) ) var offset = place . toOffset ( { line : 3 , column : 3 } ) // => 10 place . toPoint ( offset ) // => {line: 3, column: 3, offset: 10} 原料药 该软件包导出以下标识符:
【文件预览】:
vfile-location-main
----.gitignore(57B)
----package.json(2KB)
----.npmrc(19B)
----index.js(2KB)
----tsconfig.json(324B)
----test.js(4KB)
----.github()
--------workflows()
----.prettierignore(15B)
----license(1KB)
----readme.md(3KB)
----.editorconfig(147B)

网友评论