File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ function classNameIsValid(className) {
7676 className === '_SCHEMA' || //TODO: remove this, as _SCHEMA is not a valid class name for storing Parse Objects.
7777 className === '_Role' ||
7878 joinClassRegex . test ( className ) ||
79- classAndFieldRegex . test ( className )
79+ //Class names have the same constraints as field names, but also allow the previous additional names.
80+ fieldNameIsValid ( className )
8081 ) ;
8182}
8283
Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ function mongoFieldTypeToSchemaAPIType(type) {
3232
3333function mongoSchemaAPIResponseFields ( schema ) {
3434 fieldNames = Object . keys ( schema ) . filter ( key => key !== '_id' ) ;
35- response = { } ;
36- fieldNames . forEach ( fieldName => {
37- response [ fieldName ] = mongoFieldTypeToSchemaAPIType ( schema [ fieldName ] ) ;
38- } ) ;
35+ response = fieldNames . reduce ( ( obj , fieldName ) => {
36+ obj [ fieldName ] = mongoFieldTypeToSchemaAPIType ( schema [ fieldName ] )
37+ return obj ;
38+ } , { } ) ;
3939 response . ACL = { type : 'ACL' } ;
4040 response . createdAt = { type : 'Date' } ;
4141 response . updatedAt = { type : 'Date' } ;
You can’t perform that action at this time.
0 commit comments