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

Function main

src/scripts/hatAdjustments/average.ts:35–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33}
34
35function main() {
36 const fullMap = Object.fromEntries(
37 HAT_SHAPES.map((shape) => {
38 const originalAdjustment = defaultShapeAdjustments[shape] ?? {};
39 const newAdjustment = newAdjustments[shape] ?? {};
40
41 return [
42 shape,
43 {
44 sizeAdjustment: processProperty(
45 originalAdjustment,
46 newAdjustment,
47 "sizeAdjustment"
48 ),
49 verticalOffset: processProperty(
50 originalAdjustment,
51 newAdjustment,
52 "verticalOffset"
53 ),
54 },
55 ];
56 })
57 );
58
59 (["value", "originalAdjustment", "newAdjustment"] as const).forEach((key) => {
60 const map = Object.fromEntries(
61 HAT_SHAPES.map((shape) => {
62 return [
63 shape,
64 {
65 sizeAdjustment: fullMap[shape].sizeAdjustment[key],
66 verticalOffset: fullMap[shape].verticalOffset[key],
67 },
68 ];
69 })
70 ) as IndividualHatAdjustmentMap;
71 console.log(`${key}: `);
72 console.log(JSON.stringify(map, null, 2));
73 });
74}
75
76main();
77

Callers 1

average.tsFile · 0.70

Calls 2

logMethod · 0.80
processPropertyFunction · 0.70

Tested by

no test coverage detected