Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
refactor(fix): changes to address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoemery committed Jun 20, 2018
1 parent ca13536 commit 1a39e37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/opencensus-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"@types/shimmer": "^1.0.1",
"@types/uuid": "^3.4.3",
"gts": "^0.5.4",
"intercept-stdout": "^0.1.2",
"mocha": "^5.0.4",
"ncp": "^2.0.0",
"nyc": "11.6.0",
"ts-node": "^4.0.0",
"intercept-stdout": "^0.1.2",
"typescript": "~2.6.1"
},
"dependencies": {
Expand Down
3 changes: 0 additions & 3 deletions packages/opencensus-core/src/internal/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

import * as crypto from 'crypto';


// TODO: rethink this snippet aproach

// Use 6 bytes of randomness only as JS numbers are doubles not 64-bit ints.
const SPAN_ID_RANDOM_BYTES = 6;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ import * as types from './types';
* Maps a name (key) representing a internal file module and its exports
*/
export type ModuleExportsMapping = {
// tslint:disable:no-any
// tslint:disable-next-line:no-any
[key: string]: any;
};


/** This class represent the base to patch plugin. */
export abstract class BasePlugin implements types.Plugin {
/** Exports from the nodejs module to be instrumented */
// tslint:disable:no-any
// tslint:disable-next-line:no-any
protected moduleExports: any;
/** The module name */
protected moduleName: string;
Expand Down Expand Up @@ -66,8 +66,8 @@ export abstract class BasePlugin implements types.Plugin {
* @param version module version description
* @param basedir module absolute path
*/
// tslint:disable:no-any
private setPluginContext(
// tslint:disable-next-line:no-any
moduleExports: any, tracer: modelTypes.Tracer, version: string,
basedir?: string) {
this.moduleExports = moduleExports;
Expand All @@ -90,9 +90,9 @@ export abstract class BasePlugin implements types.Plugin {
* @param version version of the current instaled module to patch
* @param basedir module absolute path
*/
enable(
// tslint:disable:no-any
moduleExports: any, tracer: modelTypes.Tracer, version: string,
enable<T>(
// tslint:disable-next-line:no-any
moduleExports: T, tracer: modelTypes.Tracer, version: string,
basedir: string) {
this.setPluginContext(moduleExports, tracer, version, basedir);
return this.applyPatch();
Expand All @@ -107,10 +107,10 @@ export abstract class BasePlugin implements types.Plugin {
* This method implements the GoF Template Method Pattern,
* 'applyPatch' is the variant part, each instrumentation should
* implement its own version, 'enable' method is the invariant.
* Wil be called when enable is called.
* It will be called when enable is called.
*
*/
// tslint:disable:no-any
// tslint:disable-next-line:no-any
protected abstract applyPatch(): any;
protected abstract applyUnpatch(): void;

Expand Down

0 comments on commit 1a39e37

Please sign in to comment.