Open hadimostafapour opened 1 year ago
@hadimostafapour I like the direction where it goes, but I am not sure that such extension of config type is a right thing to do. Let's say, someone wants to specify a source for each platform individually, then they need to pass some dummy source to favicons()
function to bypass a validator.
There are other ways to achieve similar result. E.g. extend
type Source = string | Buffer | (string | Buffer)[];
type PerPlatform<T> = Record<PlatformName | '*', T>;
export async function favicons(
source: Source | PerPlatform<Source>,
options: FaviconOptions = {}
): Promise<FaviconResponse> {
// ...
}