src/utils/index.js
function filterSourceMap(testRegex, includeRegex, sourceMap, excludeRegex) {
  const outputData = Object.assign({});
  const testTestRegex = testRegex || /./g;
  const testIncludeRegex = includeRegex || null;
  const testExcludeRegex = excludeRegex || null;

  if (typeof testTestRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, test regex must be type object, got ${typeof testRegex}.`); }
  if (typeof testIncludeRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, include regex must be type object, got ${typeof testIncludeRegex}.`); }
  if (typeof testExcludeRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, exclude regex must be type object, got ${typeof testExcludeRegex}.`); }

  Object.keys(sourceMap).forEach((key) => {
    if (testTestRegex.test(key)
      && (testIncludeRegex === null || testIncludeRegex.test(key))
      && (testExcludeRegex === null || !testExcludeRegex.test(key))) {
      Object.assign(outputData, { [key]: sourceMap[key] });
    }
  });

  return outputData;
}
function filterSourceMap(testRegex, includeRegex, sourceMap, excludeRegex) {
  const outputData = Object.assign({});
  const testTestRegex = testRegex || /./g;
  const testIncludeRegex = includeRegex || null;
  const testExcludeRegex = excludeRegex || null;

  if (typeof testTestRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, test regex must be type object, got ${typeof testRegex}.`); }
  if (typeof testIncludeRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, include regex must be type object, got ${typeof testIncludeRegex}.`); }
  if (typeof testExcludeRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, exclude regex must be type object, got ${typeof testExcludeRegex}.`); }

  Object.keys(sourceMap).forEach((key) => {
    if (testTestRegex.test(key)
      && (testIncludeRegex === null || testIncludeRegex.test(key))
      && (testExcludeRegex === null || !testExcludeRegex.test(key))) {
      Object.assign(outputData, { [key]: sourceMap[key] });
    }
  });

  return outputData;
}
function filterSourceMap ( testRegex , includeRegex , sourceMap , excludeRegex ) { const outputData = Object . assign ( { } ) ; const testTestRegex = testRegex || / . / g ; const testIncludeRegex = includeRegex || null ; const testExcludeRegex = excludeRegex || null ; if ( typeof testTestRegex !== 'object' ) { throw error ( ` ${ JSON . stringify ( sourceMap ) } ${ typeof testRegex } ` ) ; } if ( typeof testIncludeRegex !== 'object' ) { throw error ( ` ${ JSON . stringify ( sourceMap ) } ${ typeof testIncludeRegex } ` ) ; } if ( typeof testExcludeRegex !== 'object' ) { throw error ( ` ${ JSON . stringify ( sourceMap ) } ${ typeof testExcludeRegex } ` ) ; } Object . keys ( sourceMap ) . forEach ( ( key ) => { if ( testTestRegex . test ( key ) && ( testIncludeRegex === null || testIncludeRegex . test ( key ) ) && ( testExcludeRegex === null || ! testExcludeRegex . test ( key ) ) ) { Object . assign ( outputData , { [ key ] : sourceMap [ key ] } ) ; } } ) ; return outputData ; }
Filters a given sourcemap by specific test regex's.

@method filterSourceMap
@param {Regex} testRegex the test regex (only include these files)
@param {Regex} includeRegex the include test regex (only include these files)
@param {Object} sourceMap the complete file sourcemap
@return {Object} filteredSourceMap the filtered sourcemap
 /*
function filterSourceMap(testRegex, includeRegex, sourceMap, excludeRegex) {
const outputData = Object.assign({});
const testTestRegex = testRegex || /./g;
const testIncludeRegex = includeRegex || /./g;
const testExcludeRegex = excludeRegex || null;

if (typeof testTestRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, test regex must be type object, got ${typeof testRegex}.`); }
if (typeof testIncludeRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, include regex must be type object, got ${typeof testIncludeRegex}.`); }
if (typeof testExcludeRegex !== 'object') { throw error(`while filtering source map, ${JSON.stringify(sourceMap)}, exclude regex must be type object, got ${typeof testExcludeRegex}.`); }

Object.keys(sourceMap).forEach((key) => {
if (testTestRegex.test(key) && testIncludeRegex.test(key) && (testExcludeRegex === null || !testExcludeRegex.test(key))) {
if (sourceMap[key]) {
outputData[key] = sourceMap[key];
}
}
});

return outputData;
}
Filters a given sourcemap by specific test regex s .