Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • InstrumentationNodeModuleFile

Implements

Index

Constructors

  • new InstrumentationNodeModuleFile(name: string, supportedVersions: string[], patch: ((moduleExports: any, moduleVersion?: string) => any), unpatch: ((moduleExports?: any, moduleVersion?: string) => void)): InstrumentationNodeModuleFile

Properties

name: string

Name of file to be patched with relative path

patch: ((moduleExports: any, moduleVersion?: string) => any)

Type declaration

    • (moduleExports: any, moduleVersion?: string): any
    • Parameters

      • moduleExports: any
      • Optional moduleVersion: string

      Returns any

supportedVersions: string[]

Supported versions for the file.

A module version is supported if one of the supportedVersions in the array satisfies the module version. The syntax of the version is checked with the satisfies function of "The semantic versioner for npm", see semver package If the version is not supported, we won't apply instrumentation patch. If omitted, all versions of the module will be patched.

It is recommended to always specify a range that is bound to a major version, to avoid breaking changes. New major versions should be reviewed and tested before being added to the supportedVersions array.

Example: ['>=1.2.3 <3']

unpatch: ((moduleExports?: any, moduleVersion?: string) => void)

Type declaration

    • (moduleExports?: any, moduleVersion?: string): void
    • Parameters

      • Optional moduleExports: any
      • Optional moduleVersion: string

      Returns void

Generated using TypeDoc