Code coverage report for lib/evalView.js

Statements: 100% (3 / 3)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

All files » lib/ » evalView.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21    1 1   8                              
'use strict';
 
module.exports = evalView;
function evalView(input) {
  /*jshint evil: true */
  return eval([
    '(function () {',
    '  return function (doc) {',
    '    var emitted = false;',
    '    var emit = function (a, b) {',
    '      emitted = true;',
    '    };',
    '    var view = ' + input + ';',
    '    view(doc);',
    '    if (emitted) {',
    '      return true;',
    '    }',
    '  }',
    '})()'
  ].join('\n'));
}