fix cypress compatibility

deepsource-autofix-76c6eb20
Dan Gowans 2023-03-23 15:27:25 -04:00
parent 29f69945e5
commit 60f0a13959
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import cluster from 'node:cluster';
import hasOwn from 'object.hasown'; import hasOwn from 'object.hasown';
import cluster from 'cluster';
import Debug from 'debug'; import Debug from 'debug';
const debug = Debug('lot-occupancy-system:polyfills'); const debug = Debug('lot-occupancy-system:polyfills');
export function applyPolyfills() { export function applyPolyfills() {
@ -7,7 +7,8 @@ export function applyPolyfills() {
debug('Applying Object.hasOwn(o, v) polyfill'); debug('Applying Object.hasOwn(o, v) polyfill');
Object.hasOwn = hasOwn; 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'); debug('Applying cluster.setupPrimary() polyfill');
cluster.setupPrimary = cluster.setupMaster; cluster.setupPrimary = cluster.setupMaster;
} }

View File

@ -1,6 +1,8 @@
import cluster from 'node:cluster'
import hasOwn from 'object.hasown' import hasOwn from 'object.hasown'
// eslint-disable-next-line unicorn/prefer-node-protocol
import cluster from 'cluster'
import Debug from 'debug' import Debug from 'debug'
const debug = Debug('lot-occupancy-system:polyfills') const debug = Debug('lot-occupancy-system:polyfills')
@ -10,7 +12,10 @@ export function applyPolyfills(): void {
Object.hasOwn = hasOwn 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') debug('Applying cluster.setupPrimary() polyfill')
cluster.setupPrimary = cluster.setupMaster cluster.setupPrimary = cluster.setupMaster
} }