UNPKG

opentelemetry-instrumentation-typeorm

Version:

open telemetry instrumentation for the `typeorm` module

15 lines 557 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getParamNames = void 0; const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm; const ARGUMENT_NAMES = /([^\s,]+)/g; function getParamNames(func) { const fnStr = func.toString().replace(STRIP_COMMENTS, ''); let result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES); if (result === null) { result = []; } return result; } exports.getParamNames = getParamNames; //# sourceMappingURL=get-func-param-names.js.map