shru-design-system 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/apply-theme-sync.js +13 -13
package/package.json
CHANGED
|
@@ -88,26 +88,26 @@
|
|
|
88
88
|
function loadJSONSync(relativePath, bases) {
|
|
89
89
|
for (var i = 0; i < bases.length; i++) {
|
|
90
90
|
var base = bases[i];
|
|
91
|
-
|
|
91
|
+
try {
|
|
92
92
|
var url = base.endsWith('/') ? base + relativePath : base + '/' + relativePath;
|
|
93
|
-
|
|
93
|
+
var xhr = new XMLHttpRequest();
|
|
94
94
|
xhr.open('GET', url, false);
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
xhr.send(null);
|
|
96
|
+
|
|
97
97
|
// 404 means file doesn't exist - try next base
|
|
98
|
-
|
|
98
|
+
if (xhr.status === 404) {
|
|
99
99
|
continue;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (xhr.status === 200 || xhr.status === 0) {
|
|
103
|
+
var contentType = xhr.getResponseHeader('content-type');
|
|
104
|
+
// Check if response is actually JSON (not HTML error page)
|
|
105
|
+
if (contentType && contentType.includes('application/json')) {
|
|
106
|
+
return JSON.parse(xhr.responseText);
|
|
100
107
|
}
|
|
101
|
-
|
|
102
|
-
if (xhr.status === 200 || xhr.status === 0) {
|
|
103
|
-
var contentType = xhr.getResponseHeader('content-type');
|
|
104
|
-
// Check if response is actually JSON (not HTML error page)
|
|
105
|
-
if (contentType && contentType.includes('application/json')) {
|
|
106
|
-
return JSON.parse(xhr.responseText);
|
|
107
|
-
}
|
|
108
108
|
// If not JSON (likely HTML error page), try next base
|
|
109
109
|
continue;
|
|
110
|
-
|
|
110
|
+
}
|
|
111
111
|
} catch (e) {
|
|
112
112
|
// Try next base
|
|
113
113
|
}
|