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

Function parseField

lib/index.es.js:2882–2901  ·  view source on GitHub ↗
(fieldName)

Source from the content-addressed store, hash-verified

2880
2881// Converts a string in dot notation to an array of its components, with backslash escaping
2882function parseField(fieldName) {
2883 // fields may be deep (e.g. "foo.bar.baz"), so parse
2884 var fields = [];
2885 var current = '';
2886 for (var i = 0, len = fieldName.length; i < len; i++) {
2887 var ch = fieldName[i];
2888 if (i > 0 && fieldName[i - 1] === '\\' && (ch === '$' || ch === '.')) {
2889 // escaped delimiter
2890 current = current.substring(0, current.length - 1) + ch;
2891 } else if (ch === '.') {
2892 // When `.` is not escaped (above), it is a field delimiter
2893 fields.push(current);
2894 current = '';
2895 } else { // normal character
2896 current += ch;
2897 }
2898 }
2899 fields.push(current);
2900 return fields;
2901}
2902
2903var combinationFields = ['$or', '$nor', '$not'];
2904function isCombinationalField(field) {

Callers 3

getFieldValuesAsArrayFunction · 0.70
rowFilterFunction · 0.70
matchSelectorFunction · 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…