UNPKG

880 BTypeScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 */
8/// <reference types="lodash" />
9/**
10 * Given an array of files, it groups it by it's type.
11 * Type of the file is inferred from it's mimetype based on the extension
12 * file ends up with. The returned value is an object with properties that
13 * correspond to the first part of the mimetype, e.g. images will be grouped
14 * under `image` key since the mimetype for them is `image/jpg` etc.
15 *
16 * Example:
17 * Given an array ['fonts/a.ttf', 'images/b.jpg'],
18 * the returned object will be: {font: ['fonts/a.ttf'], image: ['images/b.jpg']}
19 */
20export default function groupFilesByType(assets: Array<string>): import("lodash").Dictionary<string[]>;
21//# sourceMappingURL=groupFilesByType.d.ts.map
\No newline at end of file