« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content/dependencies/generateGroupSecondaryNav.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/dependencies/generateGroupSecondaryNav.js')
-rw-r--r--src/content/dependencies/generateGroupSecondaryNav.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/content/dependencies/generateGroupSecondaryNav.js b/src/content/dependencies/generateGroupSecondaryNav.js
index c649e300..e9c7004d 100644
--- a/src/content/dependencies/generateGroupSecondaryNav.js
+++ b/src/content/dependencies/generateGroupSecondaryNav.js
@@ -1,3 +1,5 @@
+import {atOffset} from '#sugar';
+
 export default {
   contentDependencies: [
     'generateColorStyleAttribute',
@@ -23,14 +25,10 @@ export default {
 
     return {
       previousGroup:
-        (index > 0
-          ? groups[index - 1]
-          : null),
+        atOffset(groups, index, -1),
 
       nextGroup:
-        (index < groups.length - 1
-          ? groups[index + 1]
-          : null),
+        atOffset(groups, index, +1),
     };
   },