Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: esm suport #5298

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@
* limitations under the License.
*/
import * as process from 'process';

import { getMachineId as getMachineIdDarwin } from './getMachineId-darwin';
import { getMachineId as getMachineIdLinux } from './getMachineId-linux';
import { getMachineId as getMachineIdWin } from './getMachineId-win';
import { getMachineId as getMachineIdBsd } from './getMachineId-bsd';
import { getMachineId as getMachineIdUnsupported } from './getMachineId-unsupported';
let getMachineId: () => Promise<string>;

switch (process.platform) {
case 'darwin':
({ getMachineId } = require('./getMachineId-darwin'));
getMachineId = getMachineIdDarwin;

Check warning on line 26 in packages/opentelemetry-resources/src/detectors/platform/node/machine-id/getMachineId.ts

View check run for this annotation

Codecov / codecov/patch

packages/opentelemetry-resources/src/detectors/platform/node/machine-id/getMachineId.ts#L26

Added line #L26 was not covered by tests
break;
case 'linux':
({ getMachineId } = require('./getMachineId-linux'));
getMachineId = getMachineIdLinux;
break;
case 'freebsd':
({ getMachineId } = require('./getMachineId-bsd'));
getMachineId = getMachineIdBsd;

Check warning on line 32 in packages/opentelemetry-resources/src/detectors/platform/node/machine-id/getMachineId.ts

View check run for this annotation

Codecov / codecov/patch

packages/opentelemetry-resources/src/detectors/platform/node/machine-id/getMachineId.ts#L32

Added line #L32 was not covered by tests
break;
case 'win32':
({ getMachineId } = require('./getMachineId-win'));
getMachineId = getMachineIdWin;

Check warning on line 35 in packages/opentelemetry-resources/src/detectors/platform/node/machine-id/getMachineId.ts

View check run for this annotation

Codecov / codecov/patch

packages/opentelemetry-resources/src/detectors/platform/node/machine-id/getMachineId.ts#L35

Added line #L35 was not covered by tests
break;
default:
({ getMachineId } = require('./getMachineId-unsupported'));
getMachineId = getMachineIdUnsupported;
break;

Check warning on line 39 in packages/opentelemetry-resources/src/detectors/platform/node/machine-id/getMachineId.ts

View check run for this annotation

Codecov / codecov/patch

packages/opentelemetry-resources/src/detectors/platform/node/machine-id/getMachineId.ts#L38-L39

Added lines #L38 - L39 were not covered by tests
}

export { getMachineId };
Loading