index.js
function _serveFile(requestedFile, done) {
        let compiled
            , temp = []
            , wasCompiled;

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


        if (requestedFile.sha) {
            delete requestedFile.sha; //simple hack i used to prevent infinite loop
            _feedBuffer(requestedFile, done);
            compile();
            return;
        }

        while (compiled = _compiledBuffer.shift()) {
            if (_normalize(compiled.path) === _normalize(requestedFile.path)) {
                wasCompiled = true;
                done(null, compiled.contents.toString());
            } else {
                temp.unshift(compiled);
            }
        }

        //refeed buffer
        _compiledBuffer = temp;

        //if file was not found in the stream
        //maybe it is not compiled or it is a definition file, so we don't need to worry about
        if (!wasCompiled) {
            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) {
        let compiled
            , temp = []
            , wasCompiled;

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


        if (requestedFile.sha) {
            delete requestedFile.sha; //simple hack i used to prevent infinite loop
            _feedBuffer(requestedFile, done);
            compile();
            return;
        }

        while (compiled = _compiledBuffer.shift()) {
            if (_normalize(compiled.path) === _normalize(requestedFile.path)) {
                wasCompiled = true;
                done(null, compiled.contents.toString());
            } else {
                temp.unshift(compiled);
            }
        }

        //refeed buffer
        _compiledBuffer = temp;

        //if file was not found in the stream
        //maybe it is not compiled or it is a definition file, so we don't need to worry about
        if (!wasCompiled) {
            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 ) { let compiled , temp = [ ] , wasCompiled ; log . debug ( ` ${ transformPath ( requestedFile . path ) } ` ) ; if ( requestedFile . sha ) { delete requestedFile . sha ; //simple hack i used to prevent infinite loop _feedBuffer ( requestedFile , done ) ; compile ( ) ; return ; } while ( compiled = _compiledBuffer . shift ( ) ) { if ( _normalize ( compiled . path ) === _normalize ( requestedFile . path ) ) { wasCompiled = true ; done ( null , compiled . contents . toString ( ) ) ; } else { temp . unshift ( compiled ) ; } } //refeed buffer _compiledBuffer = temp ; //if file was not found in the stream //maybe it is not compiled or it is a definition file, so we don't need to worry about if ( ! wasCompiled ) { log . debug ( ` ${ requestedFile . originalPath } ` ) ; done ( null , dummyFile ( "This file was not compiled" ) ) ; } }
Used to fetch files from buffer if requested file contains a sha defined, it means this file was changed by karma
Used to fetch files from buffer if requested file contains a sha defined it means this file was changed by karma