(dynamic: boolean)
| 73 | readdir(dir).then((list) => new Set(list)); |
| 74 | |
| 75 | const defaultFileReader = (dynamic: boolean): FileReader => { |
| 76 | const cache: Record<string, string | Buffer | undefined> = {}; |
| 77 | return async (path) => { |
| 78 | const buffer = (!dynamic && cache[path]) || (await readFile(path)); |
| 79 | cache[path] = buffer; |
| 80 | return buffer; |
| 81 | }; |
| 82 | }; |
| 83 | |
| 84 | const minimalContentTypeResolver: ContentTypeResolver = (ext) => { |
| 85 | const mimeTypes = { |