MCPcopy Index your code
hub / github.com/apache/pouchdb / evalView

Function evalView

lib/index.js:3912–3927  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

3910}
3911
3912function evalView(input) {
3913 var code = [
3914 '"use strict";',
3915 'var emitted = false;',
3916 'var emit = function (a, b) {',
3917 ' emitted = true;',
3918 '};',
3919 'var view = ' + input + ';',
3920 'view(doc);',
3921 'if (emitted) {',
3922 ' return true;',
3923 '}'
3924 ].join('\n');
3925
3926 return vm.runInNewContext('(function(doc) {\n' + code + '\n})');
3927}
3928
3929function validate(opts, callback) {
3930 if (opts.selector) {

Callers 1

filterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…