UNPKG

@mos-connection/connector

Version:
27 lines 922 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PROFILE_VALIDNESS_CHECK_WAIT_TIME = exports.isTestingWithJest = exports.safeStringify = exports.has = void 0; /** Return true if the object has a property */ function has(obj, property) { return Object.hasOwnProperty.call(obj, property); } exports.has = has; function safeStringify(obj) { if (typeof obj === 'string') { return obj; } try { return JSON.stringify(obj); } catch (e) { return `--Unable to stringify: ${e}--`; } } exports.safeStringify = safeStringify; function isTestingWithJest() { return process.env.JEST_WORKER_ID !== undefined; } exports.isTestingWithJest = isTestingWithJest; // If running in Jest, wait a bit longer before checking the profile validity: exports.PROFILE_VALIDNESS_CHECK_WAIT_TIME = isTestingWithJest() ? 500 : 100; //# sourceMappingURL=lib.js.map