@azure/monitor-opentelemetry
Version:
Azure Monitor OpenTelemetry (Node.js)
1 lines • 1.35 kB
Source Map (JSON)
{"version":3,"file":"module-cjs.cjs","sourceRoot":"","sources":["../../../src/shared/module-cjs.cts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AASlC,sDAQC;AAMD,0BAEC;AAvBD,kEAAkE;AAClE,sFAAsF;AACtF,sEAAsE;AAEtE;;GAEG;AACH,SAAgB,qBAAqB;IACnC,IAAI,CAAC;QACH,iEAAiE;QACjE,OAAO,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,yEAAyE;QACzE,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,OAAO;IACrB,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// Provides CommonJS-specific implementation for various functions\n// As per https://github.com/isaacs/tshy?tab=readme-ov-file#commonjs-dialect-polyfills\n// Encapsulating the ESM / CommonJS specific implementation as needed.\n\n/**\n * A CommonJS module loader for Azure Function Core.\n */\nexport function loadAzureFunctionCore(): ReturnType<typeof require> {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require(\"@azure/functions-core\");\n } catch (e) {\n // Module not found, this is expected in non-Azure Functions environments\n return undefined;\n }\n}\n\n/**\n * A polyfill for __dirname in CommonJS\n * @returns The directory name of the current module.\n */\nexport function dirName(): string {\n return __dirname;\n}\n"]}