« get me outta code hell

urls, upd8: default-override & optional url specs - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/urls.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-01-17 07:57:26 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-01-17 08:37:45 -0400
commit90d466482e73e7a00023151e1c894f66d1c2ad79 (patch)
tree6890707fc85d83be3d5604a9456e9b8c64788fb2 /src/urls.js
parentfcf4d18fc1973b2d4edc0cd76e9450cfccb6404c (diff)
urls, upd8: default-override & optional url specs
Diffstat (limited to 'src/urls.js')
-rw-r--r--src/urls.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/urls.js b/src/urls.js
index 1a471b30..71173f7f 100644
--- a/src/urls.js
+++ b/src/urls.js
@@ -11,6 +11,13 @@ import {withEntries} from '#sugar';
 export * from './url-spec.js';
 
 export function generateURLs(urlSpec) {
+  if (
+    typeof urlSpec.localized === 'object' &&
+    typeof urlSpec.localizedWithBaseDirectory !== 'object'
+  ) {
+    throw new Error(`Provided urlSpec missing localizedWithBaseDirectory`);
+  }
+
   const getValueForFullKey = (obj, fullKey) => {
     const [groupKey, subKey] = fullKey.split('.');
     if (!groupKey || !subKey) {