Skip to content

Commit 0498f4d

Browse files
emmercmwebketje
authored andcommitted
Fix: make all option properties optional
1 parent b5b8059 commit 0498f4d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/index.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@ export type CollectionConfig = {
55
/**
66
* - One or more glob patterns to match files to a collection
77
*/
8-
pattern: string | string[];
8+
pattern?: string | string[] | null;
99
/**
1010
* - A key to sort by (e.g. `date`,`title`, ..) or a custom sort function
1111
*/
12-
sortBy: string | ((a: any, b: any) => 0 | 1 | -1);
12+
sortBy?: string | ((a: any, b: any) => 0 | 1 | -1);
1313
/**
1414
* - Limit the amount of items in a collection to `limit`
1515
*/
16-
limit: number;
16+
limit?: number;
1717
/**
1818
* - Adds `next` and `previous` keys to file metadata of matched files
1919
*/
20-
refer: boolean;
20+
refer?: boolean;
2121
/**
2222
* - Whether to invert the sorting function results (asc/descending)
2323
*/
24-
reverse: boolean;
24+
reverse?: boolean;
2525
/**
2626
* - A function that gets a `Metalsmith.File` as first argument and returns `true` for every file to include in the collection
2727
*/
28-
filterBy: Function;
28+
filterBy?: Function;
2929
/**
3030
* - An object with metadata to attach to the collection, or a `json`/`yaml`filepath string to load data from (relative to `Metalsmith.directory`)
3131
*/
32-
metadata: any | string;
32+
metadata?: any | string | null;
3333
};
3434
/**
3535
* Add `collections` of files to the global metadata as a sorted array.

0 commit comments

Comments
 (0)