MCPcopy
hub / github.com/apache/pouchdb / evalView

Function evalView

lib/index.es.js:3907–3922  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

3905}
3906
3907function evalView(input) {
3908 var code = [
3909 '"use strict";',
3910 'var emitted = false;',
3911 'var emit = function (a, b) {',
3912 ' emitted = true;',
3913 '};',
3914 'var view = ' + input + ';',
3915 'view(doc);',
3916 'if (emitted) {',
3917 ' return true;',
3918 '}'
3919 ].join('\n');
3920
3921 return vm.runInNewContext('(function(doc) {\n' + code + '\n})');
3922}
3923
3924function validate(opts, callback) {
3925 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…