Skip to content

Commit

Permalink
chore: fix compilation for new references
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Nov 24, 2021
1 parent c9022f2 commit 90ba0ae
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
18 changes: 15 additions & 3 deletions experimental/packages/opentelemetry-sdk-metrics-base/src/Meter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,27 @@ export class Meter implements metrics.Meter {
return new UpDownCounter(storage, descriptor);
}

createObservableGauge(_name: string, _options?: metrics.MetricOptions, _callback?: (observableResult: metrics.ObservableResult) => void): metrics.ObservableBase {
createObservableGauge(
_name: string,
_callback: (observableResult: metrics.ObservableResult) => void,
_options?: metrics.MetricOptions,
): metrics.ObservableGauge {
throw new Error('Method not implemented.');
}

createObservableCounter(_name: string, _options?: metrics.MetricOptions, _callback?: (observableResult: metrics.ObservableResult) => void): metrics.ObservableBase {
createObservableCounter(
_name: string,
_callback: (observableResult: metrics.ObservableResult) => void,
_options?: metrics.MetricOptions,
): metrics.ObservableBase {
throw new Error('Method not implemented.');
}

createObservableUpDownCounter(_name: string, _options?: metrics.MetricOptions, _callback?: (observableResult: metrics.ObservableResult) => void): metrics.ObservableBase {
createObservableUpDownCounter(
_name: string,
_callback: (observableResult: metrics.ObservableResult) => void,
_options?: metrics.MetricOptions,
): metrics.ObservableBase {
throw new Error('Method not implemented.');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ export interface Predicate {
*/
export class PatternPredicate implements Predicate {
private _matchAll: boolean;
private _regexp?: RegExp;
private _regexp: RegExp;

constructor(pattern: string) {
if (pattern === '*') {
this._matchAll = true;
this._regexp = /.*/;
} else {
this._matchAll = false;
this._regexp = new RegExp(PatternPredicate.escapePattern(pattern));
Expand All @@ -44,7 +45,7 @@ export class PatternPredicate implements Predicate {
return true;
}

return this._regexp!.test(str);
return this._regexp.test(str);
}

static escapePattern(pattern: string): string {
Expand Down

0 comments on commit 90ba0ae

Please sign in to comment.