fix: remove all linter errors
This commit is contained in:
@@ -8,7 +8,7 @@ import { articleMetadataSchema } from "./marka/schema.ts";
|
||||
|
||||
const openAI = OPENAI_API_KEY && new OpenAI({ apiKey: OPENAI_API_KEY });
|
||||
|
||||
interface MovieRecommendation {
|
||||
export interface MovieRecommendation {
|
||||
year: number;
|
||||
title: string;
|
||||
}
|
||||
@@ -181,14 +181,14 @@ respond with a plain unordered list each item starting with the year the movie w
|
||||
|
||||
if (!res) return;
|
||||
|
||||
const recommendations = res.split("\n").map((entry) => {
|
||||
const recommendations = res.split("\n").map((entry: string) => {
|
||||
const [year, ...title] = entry.split("-");
|
||||
|
||||
return {
|
||||
year: parseInt(year.trim()),
|
||||
title: title.join(" ").replaceAll('"', "").trim(),
|
||||
};
|
||||
}).filter((y) => !Number.isNaN(y.year));
|
||||
}).filter((y: { year: number }) => !Number.isNaN(y.year));
|
||||
|
||||
cache.set(cacheId, recommendations);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user