@@ -295,12 +295,12 @@ const untransformObjectACL = ({_rperm, _wperm, ...output}) => {
295
295
}
296
296
297
297
/**
298
- * When querying, the fieldName may be compound, extract the base fieldName
298
+ * When querying, the fieldName may be compound, extract the root fieldName
299
299
* `temperature.celsius` becomes `temperature`
300
300
* @param {string } fieldName that may be a compound field name
301
- * @returns {string } the basename of the field
301
+ * @returns {string } the root name of the field
302
302
*/
303
- const getBaseFieldName = ( fieldName : string ) : string => {
303
+ const getRootFieldName = ( fieldName : string ) : string => {
304
304
return fieldName . split ( '.' ) [ 0 ]
305
305
}
306
306
@@ -421,8 +421,8 @@ class DatabaseController {
421
421
if ( fieldName . match ( / ^ a u t h D a t a \. ( [ a - z A - Z 0 - 9 _ ] + ) \. i d $ / ) ) {
422
422
throw new Parse . Error ( Parse . Error . INVALID_KEY_NAME , `Invalid field name for update: ${ fieldName } ` ) ;
423
423
}
424
- const baseFieldName = getBaseFieldName ( fieldName ) ;
425
- if ( ! SchemaController . fieldNameIsValid ( baseFieldName ) && ! isSpecialUpdateKey ( baseFieldName ) ) {
424
+ const rootFieldName = getRootFieldName ( fieldName ) ;
425
+ if ( ! SchemaController . fieldNameIsValid ( rootFieldName ) && ! isSpecialUpdateKey ( rootFieldName ) ) {
426
426
throw new Parse . Error ( Parse . Error . INVALID_KEY_NAME , `Invalid field name for update: ${ fieldName } ` ) ;
427
427
}
428
428
} ) ;
@@ -910,8 +910,8 @@ class DatabaseController {
910
910
if ( fieldName . match ( / ^ a u t h D a t a \. ( [ a - z A - Z 0 - 9 _ ] + ) \. i d $ / ) ) {
911
911
throw new Parse . Error ( Parse . Error . INVALID_KEY_NAME , `Cannot sort by ${ fieldName } ` ) ;
912
912
}
913
- const baseFieldName = getBaseFieldName ( fieldName ) ;
914
- if ( ! SchemaController . fieldNameIsValid ( baseFieldName ) ) {
913
+ const rootFieldName = getRootFieldName ( fieldName ) ;
914
+ if ( ! SchemaController . fieldNameIsValid ( rootFieldName ) ) {
915
915
throw new Parse . Error ( Parse . Error . INVALID_KEY_NAME , `Invalid field name: ${ fieldName } .` ) ;
916
916
}
917
917
} ) ;
0 commit comments