MCPcopy Index your code
hub / github.com/shipshapecode/tether / addOffset

Function addOffset

src/js/utils/offset.js:24–40  ·  view source on GitHub ↗
(...offsets)

Source from the content-addressed store, hash-verified

22};
23
24export function addOffset(...offsets) {
25 const out = { top: 0, left: 0 };
26
27 offsets.forEach(({ top, left }) => {
28 if (isString(top)) {
29 top = parseFloat(top);
30 }
31 if (isString(left)) {
32 left = parseFloat(left);
33 }
34
35 out.top += top;
36 out.left += left;
37 });
38
39 return out;
40}
41
42export function attachmentToOffset(attachment) {
43 let { left, top } = attachment;

Callers 2

offset.spec.jsFile · 0.90
positionMethod · 0.90

Calls 1

isStringFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…