MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / processProperty

Function processProperty

src/scripts/hatAdjustments/average.ts:18–33  ·  view source on GitHub ↗
(
  originalAdjustment: HatAdjustments,
  newAdjustment: HatAdjustments,
  propertyName: keyof HatAdjustments
)

Source from the content-addressed store, hash-verified

16const newAdjustments: Partial<IndividualHatAdjustmentMap> = {};
17
18function processProperty(
19 originalAdjustment: HatAdjustments,
20 newAdjustment: HatAdjustments,
21 propertyName: keyof HatAdjustments
22) {
23 const originalValue = originalAdjustment[propertyName] ?? 0;
24 const newAdjustmentValue = newAdjustment[propertyName] ?? 0;
25 const newValue = originalValue + newAdjustmentValue;
26 const value = (originalValue + newValue) / 2;
27
28 return {
29 value: postProcessValue(value),
30 originalAdjustment: postProcessValue(originalValue - value),
31 newAdjustment: postProcessValue(newValue - value),
32 };
33}
34
35function main() {
36 const fullMap = Object.fromEntries(

Callers 1

mainFunction · 0.70

Calls 1

postProcessValueFunction · 0.90

Tested by

no test coverage detected