"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.addFilesToManifestJson = addFilesToManifestJson;

var _utilities = require("./utilities");

function addFilesToManifestJson(manifestJson, option, assets, hashLength) {
  const json = manifestJson;
  Object.keys(assets).forEach(filename => {
    if (option.test(filename)) {
      const filenameNameWithoutHash = (0, _utilities.removeHashFromFileName)(filename, hashLength);
      json[filenameNameWithoutHash] = filename;
    }
  });
  return json;
}