File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1318,32 +1318,25 @@ export class BucketClient {
13181318 `features/evaluated?${ params } ` ,
13191319 ) ;
13201320
1321- if ( res ) {
1322- if ( key ) {
1323- if ( ! res . features [ key ] ) {
1324- this . logger . error ( `feature ${ key } not found` ) ;
1325- return this . _wrapRawFeature ( contextWithTracking , {
1326- key,
1327- isEnabled : false ,
1328- } ) ;
1329- }
1330- return this . _wrapRawFeature ( contextWithTracking , res . features [ key ] ) ;
1331- } else {
1332- return Object . fromEntries (
1333- Object . entries ( res . features ) . map ( ( [ featureKey , feature ] ) => [
1334- featureKey ,
1335- this . _wrapRawFeature ( contextWithTracking , feature ) ,
1336- ] ) ,
1337- ) ;
1338- }
1339- }
13401321 if ( key ) {
1322+ const feature = res ?. features [ key ] ;
1323+ if ( ! feature ) {
1324+ this . logger . error ( `feature ${ key } not found` ) ;
1325+ }
13411326 return this . _wrapRawFeature ( contextWithTracking , {
13421327 key,
13431328 isEnabled : false ,
1329+ ...feature ,
13441330 } ) ;
13451331 } else {
1346- return { } ;
1332+ return res ?. features
1333+ ? Object . fromEntries (
1334+ Object . entries ( res ?. features ) . map ( ( [ featureKey , feature ] ) => [
1335+ featureKey ,
1336+ this . _wrapRawFeature ( contextWithTracking , feature ) ,
1337+ ] ) ,
1338+ )
1339+ : { } ;
13471340 }
13481341 }
13491342}
You can’t perform that action at this time.
0 commit comments