I am trying to filter collection queries by sub-directory as described here in the docs: https://docs.astro.build/en/guides/content-collections/#querying-collections
Following the example for filtering entries, my code looks like this:
const posts = await getCollection("docs", ({id}) => {
return id.startsWith("v1/");
});```
i.e. I only want to get entries under the v1 subdirectory under content/docs/v1
Intellisense confirms that `id` points to all the entries I have in my v1 and v2 subdirectories. However, I get this type error in the filter function parameter
> Argument of type '({ id }: CollectionEntry<"zine">) => boolean' is not assignable to parameter of type '(entry: CollectionEntry<"zine">) => entry is CollectionEntry<"zine">'.
> Signature '({ id }: CollectionEntry<"zine">): boolean' must be a type predicate. ts(2345)
To be clear, this code still works and filters the entries as intended. However, I am not sure how to get the TS compiler to stop complaining.