chore: More typescript FIXME's removed
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
import { Node } from "prosemirror-model";
|
||||
import { parser } from "rich-markdown-editor";
|
||||
|
||||
export default function parseImages(text: string): string[] {
|
||||
const value = parser.parse(text);
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'images' implicitly has type 'any[]' in s... Remove this comment to see the full error message
|
||||
const images = [];
|
||||
const images: string[] = [];
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'node' implicitly has an 'any' type.
|
||||
function findImages(node) {
|
||||
function findImages(node: Node) {
|
||||
if (node.type.name === "image") {
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'images' implicitly has an 'any[]' type.
|
||||
if (!images.includes(node.attrs.src)) {
|
||||
images.push(node.attrs.src);
|
||||
}
|
||||
@@ -24,6 +22,5 @@ export default function parseImages(text: string): string[] {
|
||||
}
|
||||
|
||||
findImages(value);
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'images' implicitly has an 'any[]' type.
|
||||
return images;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user