From fb0af2837dbcd90dcf18a1f05bed4aff498a0d72 Mon Sep 17 00:00:00 2001 From: Ralf Nieuwenhuizen Date: Tue, 17 Dec 2019 10:04:02 +0100 Subject: [PATCH] Fix olofd#94 --- local-cli/link/groupFilesByType.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/local-cli/link/groupFilesByType.js b/local-cli/link/groupFilesByType.js index 5dc692e..c97c05c 100644 --- a/local-cli/link/groupFilesByType.js +++ b/local-cli/link/groupFilesByType.js @@ -1,15 +1,18 @@ -const groupBy = require('lodash').groupBy; -const mime = require('mime'); +const groupBy = require("lodash").groupBy; +const mime = require("mime"); /** * Since there are no officially registered MIME types * for ttf/otf yet http://www.iana.org/assignments/media-types/media-types.xhtml, * we define two non-standard ones for the sake of parsing */ -mime.define({ - 'font/opentype': ['otf'], - 'font/truetype': ['ttf'], -}); +mime.define( + { + "font/opentype": ["otf"], + "font/truetype": ["ttf"] + }, + true +); /** * Given an array of files, it groups it by it's type. @@ -23,5 +26,5 @@ mime.define({ * the returned object will be: {font: ['fonts/a.ttf'], image: ['images/b.jpg']} */ module.exports = function groupFilesByType(assets) { - return groupBy(assets, type => mime.lookup(type).split('/')[0]); + return groupBy(assets, type => mime.lookup(type).split("/")[0]); };