MeasurementStatisticsRequirements,
WorkerChoiceStrategyOptions
} from './pools/selection-strategies/selection-strategies-types'
+import type { KillBehavior } from './worker/worker-options'
/**
* An intentional empty function.
/**
* Rounds the given number to the given scale.
+ * The rounding is done using the "round half away from zero" method.
*
* @param num - The number to round.
* @param scale - The scale to round to.
obj !== null &&
obj?.constructor === Object &&
Object.prototype.toString.call(obj) === '[object Object]'
+
+/**
+ * Detects whether the given value is a kill behavior or not.
+ *
+ * @typeParam KB - Which specific KillBehavior type to test against.
+ * @param killBehavior - Which kind of kill behavior to detect.
+ * @param value - Any value.
+ * @returns `true` if `value` was strictly equals to `killBehavior`, otherwise `false`.
+ */
+export const isKillBehavior = <KB extends KillBehavior>(
+ killBehavior: KB,
+ value: unknown
+): value is KB => {
+ return value === killBehavior
+}