"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.castToError = exports.readEnv = exports.getPlatformProperties = void 0;
const constants_1 = require("./constants");
const getPlatformProperties = () => {
    if (Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]') {
        return {
            [`${constants_1.PORTKEY_HEADER_PREFIX}runtime`]: 'node',
            [`${constants_1.PORTKEY_HEADER_PREFIX}runtime-version`]: process.version,
        };
    }
    return {};
};
exports.getPlatformProperties = getPlatformProperties;
const readEnv = (env) => {
    var _a, _b;
    if (typeof process !== 'undefined') {
        return (_b = (_a = process.env) === null || _a === void 0 ? void 0 : _a[env]) !== null && _b !== void 0 ? _b : undefined;
    }
    return undefined;
};
exports.readEnv = readEnv;
const castToError = (err) => {
    if (err instanceof Error)
        return err;
    return new Error(err);
};
exports.castToError = castToError;
//# sourceMappingURL=utils.js.map