@muze-nl/jsfs-solid 0.1.2 → 0.1.4

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/dist/browser.js CHANGED
@@ -9093,7 +9093,7 @@
9093
9093
  mw: {
9094
9094
  json: jsonmw,
9095
9095
  thrower: throwermw,
9096
- gedata
9096
+ getdata: getdatamw
9097
9097
  },
9098
9098
  api,
9099
9099
  jsonApi
@@ -14237,8 +14237,35 @@
14237
14237
  }
14238
14238
  }
14239
14239
  let res = await next(req);
14240
+ if (res && isLinkedData(res.headers?.get("Content-Type"))) {
14241
+ let tempRes = res.clone();
14242
+ let body = await tempRes.text();
14243
+ try {
14244
+ let ld = context.parse(body, req.url, res.headers.get("Content-Type"));
14245
+ return res.with({
14246
+ body: ld
14247
+ });
14248
+ } catch (e) {
14249
+ }
14250
+ }
14251
+ return res;
14240
14252
  };
14241
14253
  }
14254
+ var mimetypes = [
14255
+ /^text\/turtle\b/,
14256
+ /^application\/n-quads\b/,
14257
+ /^text\/x-nquads\b/,
14258
+ /^appliction\/n-triples\b/,
14259
+ /^application\/trig\b/
14260
+ ];
14261
+ function isLinkedData(contentType) {
14262
+ for (const re of mimetypes) {
14263
+ if (re.exec(contentType)) {
14264
+ return true;
14265
+ }
14266
+ }
14267
+ return false;
14268
+ }
14242
14269
 
14243
14270
  // node_modules/@muze-nl/metro-oldm/src/index.mjs
14244
14271
  globalThis.oldmmw = oldmmw;