codemirror-mongodb
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -12,2 +12,16 @@ /** | ||
const VALUES = 'values'; | ||
const VALUE_MAPPINGS = { | ||
'BSONDate': "BSONDate('", | ||
'Binary': "Binary('", | ||
'MaxKey': 'MaxKey()', | ||
'MinKey': 'MinKey()', | ||
'NumberDecimal': "NumberDecimal('", | ||
'NumberLong': 'NumberLong(', | ||
'ObjectId': "ObjectId('", | ||
'RegExp': "RegExp('", | ||
'Timestamp': 'Timestamp(' | ||
}; | ||
// This is the old interface, kept around for now to stay | ||
@@ -203,2 +217,5 @@ // backwards-compatible. | ||
} | ||
if (completion.type === VALUES) { | ||
return VALUE_MAPPINGS[completion.text] || completion.text; | ||
} | ||
return completion.text; | ||
@@ -205,0 +222,0 @@ } |
@@ -290,3 +290,3 @@ /* eslint complexity: 0 */ | ||
const matches = [ COLON, OPEN_BRACKET ]; | ||
return nextToken.string !== OPEN_BRACKET && | ||
return (!nextToken || nextToken.string !== OPEN_BRACKET) && | ||
token.string !== CLOSE_BRACKET && | ||
@@ -293,0 +293,0 @@ (isPrevTokenMatching(matches) || isSkipPrevTokenMatching(matches)); |
{ | ||
"name": "codemirror-mongodb", | ||
"description": "Use CodeMirror with MongoDB.", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "start": "gulp", |
258591
7099