index.js
function _serveFile(requestedFile, done) {
      requestedFile.path = transformPath(requestedFile.path);

      log.debug(`Fetching ${requestedFile.path} from buffer`);

      // We get a requestedFile with an sha when Karma is watching files on
      // disk, and the file requested changed. When this happens, we need to
      // recompile the whole lot.
      if (requestedFile.sha) {
        delete requestedFile.sha; // Hack used to prevent infinite loop.
        enqueueForServing(requestedFile, done);
        // eslint-disable-next-line no-use-before-define
        compile();
        return;
      }

      const normalized = _normalize(requestedFile.path);
      const compiled = compilationResults[normalized];
      if (compiled) {
        delete compilationResults[normalized];
        done(null, compiled.contents.toString());
        return;
      }

      // If the file was not found in the stream, then maybe it is not compiled
      // or it is a definition file.
      log.debug(`${requestedFile.originalPath} was not found. Maybe it was \
not compiled or it is a definition file.`);
      done(null, dummyFile("This file was not compiled"));
    }
function _serveFile(requestedFile, done) {
      requestedFile.path = transformPath(requestedFile.path);

      log.debug(`Fetching ${requestedFile.path} from buffer`);

      // We get a requestedFile with an sha when Karma is watching files on
      // disk, and the file requested changed. When this happens, we need to
      // recompile the whole lot.
      if (requestedFile.sha) {
        delete requestedFile.sha; // Hack used to prevent infinite loop.
        enqueueForServing(requestedFile, done);
        // eslint-disable-next-line no-use-before-define
        compile();
        return;
      }

      const normalized = _normalize(requestedFile.path);
      const compiled = compilationResults[normalized];
      if (compiled) {
        delete compilationResults[normalized];
        done(null, compiled.contents.toString());
        return;
      }

      // If the file was not found in the stream, then maybe it is not compiled
      // or it is a definition file.
      log.debug(`${requestedFile.originalPath} was not found. Maybe it was \
not compiled or it is a definition file.`);
      done(null, dummyFile("This file was not compiled"));
    }
function _serveFile ( requestedFile , done ) { requestedFile . path = transformPath ( requestedFile . path ) ; log . debug ( ` ${ requestedFile . path } ` ) ; // We get a requestedFile with an sha when Karma is watching files on // disk, and the file requested changed. When this happens, we need to // recompile the whole lot. if ( requestedFile . sha ) { delete requestedFile . sha ; // Hack used to prevent infinite loop. enqueueForServing ( requestedFile , done ) ; // eslint-disable-next-line no-use-before-define compile ( ) ; return ; } const normalized = _normalize ( requestedFile . path ) ; const compiled = compilationResults [ normalized ] ; if ( compiled ) { delete compilationResults [ normalized ] ; done ( null , compiled . contents . toString ( ) ) ; return ; } // If the file was not found in the stream, then maybe it is not compiled // or it is a definition file. log . debug ( ` ${ requestedFile . originalPath } \
 ` ) ; done ( null , dummyFile ( "This file was not compiled" ) ) ; }
Used to fetch files from buffer.
Used to fetch files from buffer .