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

Function stringify

lib/index-browser.es.js:7990–8007  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

7988}
7989
7990function stringify(input) {
7991 if (!input) {
7992 return 'undefined'; // backwards compat for empty reduce
7993 }
7994 // for backwards compat with mapreduce, functions/strings are stringified
7995 // as-is. everything else is JSON-stringified.
7996 switch (typeof input) {
7997 case 'function':
7998 // e.g. a mapreduce map
7999 return input.toString();
8000 case 'string':
8001 // e.g. a mapreduce built-in _reduce function
8002 return input.toString();
8003 default:
8004 // e.g. a JSON object in the case of mango queries
8005 return JSON.stringify(input);
8006 }
8007}
8008
8009/* create a string signature for a view so we can cache it and uniq it */
8010function createViewSignature(mapFun, reduceFun) {

Callers 1

createViewSignatureFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…