debian-mirror-gitlab/spec/frontend/diffs/find_interop_attributes.js
2021-04-29 21:17:54 +05:30

20 lines
441 B
JavaScript

export const findInteropAttributes = (parent, sel) => {
const target = sel ? parent.find(sel) : parent;
if (!target.exists()) {
return null;
}
const type = target.attributes('data-interop-type');
if (!type) {
return null;
}
return {
type,
line: target.attributes('data-interop-line'),
oldLine: target.attributes('data-interop-old-line'),
newLine: target.attributes('data-interop-new-line'),
};
};