From 60f0a139594494848bc1ade9ce0302c397f0aabf Mon Sep 17 00:00:00 2001 From: Dan Gowans Date: Thu, 23 Mar 2023 15:27:25 -0400 Subject: [PATCH] fix cypress compatibility --- helpers/polyfills.js | 5 +++-- helpers/polyfills.ts | 9 +++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/helpers/polyfills.js b/helpers/polyfills.js index d535d38f..56ddd85c 100644 --- a/helpers/polyfills.js +++ b/helpers/polyfills.js @@ -1,5 +1,5 @@ -import cluster from 'node:cluster'; import hasOwn from 'object.hasown'; +import cluster from 'cluster'; import Debug from 'debug'; const debug = Debug('lot-occupancy-system:polyfills'); export function applyPolyfills() { @@ -7,7 +7,8 @@ export function applyPolyfills() { debug('Applying Object.hasOwn(o, v) polyfill'); Object.hasOwn = hasOwn; } - if (!Object.hasOwn(cluster, 'setupPrimary') && Object.hasOwn(cluster, 'setupMaster')) { + if (!Object.hasOwn(cluster, 'setupPrimary') && + Object.hasOwn(cluster, 'setupMaster')) { debug('Applying cluster.setupPrimary() polyfill'); cluster.setupPrimary = cluster.setupMaster; } diff --git a/helpers/polyfills.ts b/helpers/polyfills.ts index 922cecb8..43f447cb 100644 --- a/helpers/polyfills.ts +++ b/helpers/polyfills.ts @@ -1,6 +1,8 @@ -import cluster from 'node:cluster' import hasOwn from 'object.hasown' +// eslint-disable-next-line unicorn/prefer-node-protocol +import cluster from 'cluster' + import Debug from 'debug' const debug = Debug('lot-occupancy-system:polyfills') @@ -10,7 +12,10 @@ export function applyPolyfills(): void { Object.hasOwn = hasOwn } - if (!Object.hasOwn(cluster, 'setupPrimary') && Object.hasOwn(cluster, 'setupMaster')) { + if ( + !Object.hasOwn(cluster, 'setupPrimary') && + Object.hasOwn(cluster, 'setupMaster') + ) { debug('Applying cluster.setupPrimary() polyfill') cluster.setupPrimary = cluster.setupMaster }