all files / lib/ evalView.js

100% Statements 5/5
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12             
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
function evalView(input) {
  /* jshint evil:true */
  return new Function('doc', ['var emitted = false;', 'var emit = function (a, b) {', '  emitted = true;', '};', 'var view = ' + input + ';', 'view(doc);', 'if (emitted) {', '  return true;', '}'].join('\n'));
}
 
exports.default = evalView;
module.exports = exports['default'];