Started working on JS docs.
This commit is contained in:
@@ -7,7 +7,7 @@ export type Document = {
|
||||
line: (startOffset?: number) => string,
|
||||
head: () => string,
|
||||
tail: () => string,
|
||||
match: (matchHead: string) => boolean
|
||||
match: (matchValue: string) => boolean
|
||||
}
|
||||
|
||||
export function useDocument (reader: Reader, indent: string = ' '): Document {
|
||||
@@ -43,7 +43,7 @@ export function useDocument (reader: Reader, indent: string = ' '): Document {
|
||||
const line = (startOffset: number = lineData.offsetHead) => lineData.line.slice(startOffset)
|
||||
const head = () => lineData.line.slice(lineData.offsetHead, lineData.offsetTail)
|
||||
const tail = () => lineData.line.slice(lineData.offsetTail + 1) // Skip the space
|
||||
const match = (matchHead: string): boolean => matchHead === head()
|
||||
const match = (matchValue: string): boolean => matchValue === head()
|
||||
|
||||
return {
|
||||
next,
|
||||
|
||||
Reference in New Issue
Block a user