MCPcopy Create free account
hub / github.com/GoogleChrome/webstatus.dev / getFeature

Method getFeature

frontend/src/static/js/api/client.ts:475–510  ·  view source on GitHub ↗
(
    featureId: string,
    wptMetricView: FeatureWPTMetricViewType,
  )

Source from the content-addressed store, hash-verified

473 return result.data!;
474 }
475
476 public async getFeature(
477 featureId: string,
478 wptMetricView: FeatureWPTMetricViewType,
479 ): Promise<components['schemas']['Feature']> {
480 const qsParams: paths['/v1/features/{feature_id}']['get']['parameters']['query'] =
481 {};
482 if (wptMetricView) qsParams.wpt_metric_view = wptMetricView;
483 return this.handleResponse(
484 this.client.GET('/v1/features/{feature_id}', {
485 params: {
486 path: {feature_id: featureId},
487 query: qsParams,
488 },
489 }),
490 '/v1/features/{feature_id}',
491 'get',
492 {
493 statusHandlers: {
494 200: (data, _d, response) => {
495 if (response.redirected && isFeature(data)) {
496 const newId = response.url.split('/').pop() || '';
497 throw new FeatureMovedError('Redirected', newId, data);
498 }
499 },
500 410: error => {
501 if (isFeatureGoneError(error)) {
502 throw new FeatureGoneSplitError(
503 error.message,
504 error.new_features.map(f => f.id),
505 );
506 }
507 },
508 },
509 },
510 );
511 }
512
513 public getFeatureMetadata(

Callers 2

constructorMethod · 0.80
constructorMethod · 0.80

Calls 3

handleResponseMethod · 0.95
isFeatureFunction · 0.85
isFeatureGoneErrorFunction · 0.85

Tested by

no test coverage detected