@systemfsoftware/stryker-js 13.0.0 → 14.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.
- package/CHANGELOG.md +66 -0
- package/README.md +30 -0
- package/dist/Run.schema-DErVOVSj.d.mts +24 -0
- package/dist/Run.schema-DuaneDGd.mjs +57 -0
- package/dist/RunEnvironment.service-C8nNTyKa.d.mts +2927 -0
- package/dist/config.d.mts +4 -4
- package/dist/config.mjs +1 -1
- package/dist/events.d.mts +2 -2
- package/dist/events.mjs +2 -2
- package/dist/{index-C09A80iv.d.mts → index-C5FRZ4Ni.d.mts} +1694 -3074
- package/dist/index.d.mts +622 -101
- package/dist/index.mjs +1104 -26
- package/dist/main.mjs +49090 -30399
- package/dist/merge-config-DCQE_2cC.mjs +1473 -0
- package/dist/{merge-config-X_AxYxMY.d.mts → merge-config-IXgoKiix.d.mts} +4 -4
- package/dist/promises.d.mts +3 -3
- package/dist/promises.mjs +1 -1
- package/dist/run-stages-CGUzIzPZ.mjs +20687 -0
- package/package.json +15 -14
- package/dist/Run.schema-Bj7b_FMA.mjs +0 -269
- package/dist/Run.schema-BlvpjFjJ.d.mts +0 -325
- package/dist/RunEnvironment.service-BJAsZsdn.d.mts +0 -524
- package/dist/dist-BscHZmXN.mjs +0 -8089
- package/dist/merge-config-DA_v1hGx.mjs +0 -63
- package/dist/run-stages.cell-BN__EOCk.mjs +0 -8789
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import "./dist-BscHZmXN.mjs";
|
|
2
|
-
import * as Match from "effect/Match";
|
|
3
|
-
import * as Option from "effect/Option";
|
|
4
|
-
import * as Predicate from "effect/Predicate";
|
|
5
|
-
import { dual } from "effect/Function";
|
|
6
|
-
import * as Record from "effect/Record";
|
|
7
|
-
//#region src/config/merge-config.ts
|
|
8
|
-
/**
|
|
9
|
-
* Whether an entry takes part in a merge: a key literally named `__proto__` never does — the
|
|
10
|
-
* merged record must not gain a document-decided prototype — and an explicitly `undefined`
|
|
11
|
-
* value states that the author left the key unset, not that they want it set to nothing.
|
|
12
|
-
*/
|
|
13
|
-
const usable = (value, key) => key !== "__proto__" && value !== void 0;
|
|
14
|
-
const usableEntries = (source) => Record.filter(source, usable);
|
|
15
|
-
const isConfigRecord = (value) => Predicate.isObject(value);
|
|
16
|
-
const asConfigRecord = (value) => Option.filter(Option.fromUndefinedOr(value), isConfigRecord);
|
|
17
|
-
const mergeNested = (base, override) => Option.match(asConfigRecord(override), {
|
|
18
|
-
onNone: () => override,
|
|
19
|
-
onSome: (overrideRecord) => mergeRecords(base, overrideRecord)
|
|
20
|
-
});
|
|
21
|
-
const hasUsableMember = (key) => (merged) => merged.hasOwnProperty(key) && merged[key] !== void 0;
|
|
22
|
-
const ownValueOf = (merged, key) => Option.map(Option.liftPredicate(merged, hasUsableMember(key)), (present) => present[key]);
|
|
23
|
-
const baseRecordOf = (ownValue) => Option.filter(Option.flatMap(ownValue, Option.fromUndefinedOr), isConfigRecord);
|
|
24
|
-
const mergeKeyInto = (merged, override, key) => ({
|
|
25
|
-
...merged,
|
|
26
|
-
[key]: Option.match(baseRecordOf(ownValueOf(merged, key)), {
|
|
27
|
-
onNone: () => override,
|
|
28
|
-
onSome: (baseRecord) => mergeNested(baseRecord, override)
|
|
29
|
-
})
|
|
30
|
-
});
|
|
31
|
-
const mergeRecords = (base, overrides) => Record.reduce(usableEntries(overrides), usableEntries(base), mergeKeyInto);
|
|
32
|
-
const mergeConfig = dual(2, (defaults, overrides) => mergeRecords(defaults, overrides));
|
|
33
|
-
const isNonNullObject = (value) => typeof value === "object" && value !== null;
|
|
34
|
-
const asUnknownArray = (value) => Array.isArray(value) ? value : [];
|
|
35
|
-
const isFirstDescriptorOccurrence = (descriptors) => (descriptor, index) => typeof descriptor !== "string" || descriptors.slice(0, index).includes(descriptor) === false;
|
|
36
|
-
const mergePluginDescriptors = (parentPlugins, childPlugins) => {
|
|
37
|
-
const merged = [...parentPlugins, ...childPlugins];
|
|
38
|
-
return merged.filter(isFirstDescriptorOccurrence(merged));
|
|
39
|
-
};
|
|
40
|
-
const isConfigOptionsRecord = (value) => isNonNullObject(value) && Array.isArray(value) === false;
|
|
41
|
-
const mergeConfigRecords = (parentNested, childNested) => ({
|
|
42
|
-
...parentNested,
|
|
43
|
-
...childNested
|
|
44
|
-
});
|
|
45
|
-
const toConfigRecordOption = (value) => isConfigOptionsRecord(value) ? Option.some(value) : Option.none();
|
|
46
|
-
const inheritNested = (parentValue, childValue) => Option.match(Option.all([toConfigRecordOption(parentValue), toConfigRecordOption(childValue)]), {
|
|
47
|
-
onSome: ([parentNested, childNested]) => mergeConfigRecords(parentNested, childNested),
|
|
48
|
-
onNone: () => childValue
|
|
49
|
-
});
|
|
50
|
-
const inheritEntry = (out, key, parentValue, childValue) => Match.value(childValue).pipe(Match.when(null, () => {
|
|
51
|
-
const next = { ...out };
|
|
52
|
-
delete next[key];
|
|
53
|
-
return next;
|
|
54
|
-
}), Match.orElse(() => Match.value(key).pipe(Match.when("plugins", () => ({
|
|
55
|
-
...out,
|
|
56
|
-
[key]: mergePluginDescriptors(asUnknownArray(parentValue), asUnknownArray(childValue))
|
|
57
|
-
})), Match.orElse(() => ({
|
|
58
|
-
...out,
|
|
59
|
-
[key]: inheritNested(parentValue, childValue)
|
|
60
|
-
})))));
|
|
61
|
-
const mergeConfigs = dual(2, (parent, child) => Object.entries(child).reduce((out, entry) => inheritEntry(out, entry[0], parent[entry[0]], entry[1]), { ...parent }));
|
|
62
|
-
//#endregion
|
|
63
|
-
export { mergeConfigs as n, mergeConfig as t };
|