@@ -400,7 +400,7 @@ function processRequestOptions(req, attrNode, context) {
400400 ] . join ( '' )
401401 ) ;
402402 }
403- if ( filteredAttrNode . filter . indexOf ( filter . operator ) === - 1 ) {
403+ if ( ! filteredAttrNode . filter . includes ( filter . operator ) ) {
404404 throw new RequestError (
405405 [
406406 'Can not filter by attribute "' + filter . attribute . join ( '.' ) + '" ' ,
@@ -437,7 +437,7 @@ function processRequestOptions(req, attrNode, context) {
437437 ) ;
438438 }
439439
440- if ( subFilter . filter . indexOf ( filter . operator ) === - 1 ) {
440+ if ( ! subFilter . filter . includes ( filter . operator ) ) {
441441 throw new RequestError (
442442 `Can not filter by sub-resource attribute "${ filter . attribute . join ( '.' ) } "` +
443443 ( context . attrPath . length > 0 ? ` (in "${ context . attrPath . join ( '.' ) } ")` : '' ) +
@@ -608,7 +608,7 @@ function processRequestOptions(req, attrNode, context) {
608608 ] . join ( '' )
609609 ) ;
610610 }
611- if ( orderedAttrNode . order . indexOf ( orderPart . direction ) === - 1 ) {
611+ if ( ! orderedAttrNode . order . includes ( orderPart . direction ) ) {
612612 throw new RequestError (
613613 [
614614 'Attribute "' + orderPart . attribute . join ( '.' ) + '" ' ,
@@ -1027,7 +1027,7 @@ function resolveResourceTree(resourceTree, parentDataSourceName) {
10271027 let selectedDataSource = primaryName ;
10281028 const possibleDataSources = Object . keys ( attrInfo . subResourceAttrNode . resolvedParentKey ) ;
10291029
1030- if ( possibleDataSources . indexOf ( selectedDataSource ) === - 1 ) {
1030+ if ( ! possibleDataSources . includes ( selectedDataSource ) ) {
10311031 // just select first possible one - optimize?
10321032 selectedDataSource = possibleDataSources [ 0 ] ;
10331033 attrInfo . subResourceAttrNode . parentDataSource = selectedDataSource ;
0 commit comments