File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change 1
1
import { isNumber , isString , isUndefined } from "@core/unknownutil" ;
2
- import { ensureArray } from "../../ensure.ts " ;
2
+ import { ensure , isArray } from "@core/unknownutil " ;
3
3
import { getCachedLines } from "./getCachedLines.ts" ;
4
4
import { takeInternalLines } from "./takeInternalLines.ts" ;
5
5
import type { BaseLine , Line } from "@cosense/types/userscript" ;
@@ -90,9 +90,8 @@ export const isLineDOM = (dom: unknown): dom is HTMLDivElement =>
90
90
export const getLineCount = ( ) : number => takeInternalLines ( ) . length ;
91
91
92
92
export const getLines = ( ) : readonly Line [ ] => {
93
- const lines = getCachedLines ( ) ;
94
- ensureArray < Line > ( lines , "scrapbox.Page.lines" ) ;
95
- return lines ;
93
+ const lines = ensure ( getCachedLines ( ) , isArray ) ;
94
+ return lines as Line [ ] ;
96
95
} ;
97
96
98
97
export const getText = < T extends HTMLElement > (
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments