@systemfsoftware/stryker-js 10.2.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ import * as Option from "effect/Option";
2
+ import * as Predicate from "effect/Predicate";
3
+ import { dual } from "effect/Function";
4
+ import * as Record from "effect/Record";
5
+ //#region src/config/merge-config.ts
6
+ /**
7
+ * Whether an entry takes part in a merge: a key literally named `__proto__` never does — the
8
+ * merged record must not gain a document-decided prototype — and an explicitly `undefined`
9
+ * value states that the author left the key unset, not that they want it set to nothing.
10
+ */
11
+ const usable = (value, key) => key !== "__proto__" && value !== void 0;
12
+ const usableEntries = (source) => Record.filter(source, usable);
13
+ const isConfigRecord = (value) => Predicate.isObject(value);
14
+ const asConfigRecord = (value) => Option.filter(Option.fromUndefinedOr(value), isConfigRecord);
15
+ const mergeNested = (base, override) => Option.match(asConfigRecord(override), {
16
+ onNone: () => override,
17
+ onSome: (overrideRecord) => mergeRecords(base, overrideRecord)
18
+ });
19
+ const hasUsableMember = (key) => (merged) => merged.hasOwnProperty(key) && merged[key] !== void 0;
20
+ const ownValueOf = (merged, key) => Option.map(Option.liftPredicate(merged, hasUsableMember(key)), (present) => present[key]);
21
+ const baseRecordOf = (ownValue) => Option.filter(Option.flatMap(ownValue, Option.fromUndefinedOr), isConfigRecord);
22
+ const mergeKeyInto = (merged, override, key) => ({
23
+ ...merged,
24
+ [key]: Option.match(baseRecordOf(ownValueOf(merged, key)), {
25
+ onNone: () => override,
26
+ onSome: (baseRecord) => mergeNested(baseRecord, override)
27
+ })
28
+ });
29
+ const mergeRecords = (base, overrides) => Record.reduce(usableEntries(overrides), usableEntries(base), mergeKeyInto);
30
+ const mergeConfig = dual(2, (defaults, overrides) => mergeRecords(defaults, overrides));
31
+ //#endregion
32
+ export { mergeConfig as t };
@@ -1,5 +1,5 @@
1
- import { P as PartialStrykerOptions } from "./index-tt2EziOT.mjs";
2
- import { t as MutationTestDone } from "./mutation-test.cell-Dq23b2NP.mjs";
3
- //#region src/promises/index.d.ts
4
- export declare const run: (options: PartialStrykerOptions, targetMutatePatterns?: readonly string[]) => Promise<MutationTestDone>;
1
+ import { n as mod_d_exports$2 } from "./index-f-U3oZaJ.mjs";
2
+ import { s as MutationTestDone } from "./RunEnvironment.service-pCzdC0Sy.mjs";
3
+ //#region src/promises/mod.d.ts
4
+ export declare const run: ((targetMutatePatterns?: readonly string[]) => (options: mod_d_exports$2.PartialStrykerOptions) => Promise<MutationTestDone>) & ((options: mod_d_exports$2.PartialStrykerOptions, targetMutatePatterns?: readonly string[]) => Promise<MutationTestDone>);
5
5
  //#endregion
package/dist/promises.mjs CHANGED
@@ -1,14 +1,10 @@
1
- import { t as strykerCell } from "./src-CcqEZJIY.mjs";
2
- import * as Layer from "effect/Layer";
3
- import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem";
4
- import * as NodePath from "@effect/platform-node-shared/NodePath";
5
- import * as NodeStdio from "@effect/platform-node/NodeStdio";
1
+ import { d as nodePlatformLayer, n as strykerCell } from "./run-stages.cell-MyhsNxH2.mjs";
2
+ import { dual } from "effect/Function";
6
3
  import * as ManagedRuntime from "effect/ManagedRuntime";
7
- //#region src/promises/index.ts
8
- const runLayer = Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeStdio.layer);
9
- const run = (options, targetMutatePatterns) => {
10
- const runtime = ManagedRuntime.make(runLayer);
4
+ //#region src/promises/mod.ts
5
+ const run = dual((args) => args.length === 2 || Array.isArray(args[0]) === false, (options, targetMutatePatterns) => {
6
+ const runtime = ManagedRuntime.make(nodePlatformLayer);
11
7
  return runtime.runPromise(strykerCell(options, targetMutatePatterns)).then((done) => runtime.dispose().then(() => done), (cause) => runtime.dispose().then(() => Promise.reject(cause)));
12
- };
8
+ });
13
9
  //#endregion
14
10
  export { run };
@@ -1,7 +1,6 @@
1
1
  import "node:module";
2
2
  //#region \0rolldown/runtime.js
3
3
  var __defProp = Object.defineProperty;
4
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
5
4
  var __exportAll = (all, no_symbols) => {
6
5
  let target = {};
7
6
  for (var name in all) __defProp(target, name, {
@@ -12,4 +11,4 @@ var __exportAll = (all, no_symbols) => {
12
11
  return target;
13
12
  };
14
13
  //#endregion
15
- export { __exportAll as n, __commonJSMin as t };
14
+ export { __exportAll as t };