summaryrefslogtreecommitdiff
path: root/spec/frontend/diffs/find_interop_attributes.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/diffs/find_interop_attributes.js')
-rw-r--r--spec/frontend/diffs/find_interop_attributes.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/frontend/diffs/find_interop_attributes.js b/spec/frontend/diffs/find_interop_attributes.js
new file mode 100644
index 00000000000..d2266b20e16
--- /dev/null
+++ b/spec/frontend/diffs/find_interop_attributes.js
@@ -0,0 +1,20 @@
+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'),
+ };
+};