We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 82309f7 + 49acd65 commit d2fbb7cCopy full SHA for d2fbb7c
ExportAdapter.js
@@ -44,14 +44,16 @@ ExportAdapter.prototype.connect = function() {
44
45
// Returns a promise for a Mongo collection.
46
// Generally just for internal use.
47
+var joinRegex = /^_Join:[A-Za-z0-9_]+:[A-Za-z0-9_]+/;
48
+var otherRegex = /^[A-Za-z][A-Za-z0-9_]*$/;
49
ExportAdapter.prototype.collection = function(className) {
50
if (className !== '_User' &&
51
className !== '_Installation' &&
52
className !== '_Session' &&
53
className !== '_SCHEMA' &&
54
className !== '_Role' &&
- !className.match(/^_Join:[A-Za-z0-9_]+:[A-Za-z0-9_]+/) &&
- !className.match(/^[A-Za-z][A-Za-z0-9_]*$/)) {
55
+ !joinRegex.test(className) &&
56
+ !otherRegex.test(className)) {
57
throw new Parse.Error(Parse.Error.INVALID_CLASS_NAME,
58
'invalid className: ' + className);
59
}
0 commit comments