@muze-nl/jsfs-solid 0.1.2 → 0.1.3

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,30 @@
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
+ function isLinkedData(contentType) {
14255
+ const mimetypes = [
14256
+ "text/turtle",
14257
+ "application/n-quads",
14258
+ "text/x-nquads",
14259
+ "appliction/n-triples",
14260
+ "application/trig"
14261
+ ];
14262
+ return mimetypes.includes(contentType);
14263
+ }
14242
14264
 
14243
14265
  // node_modules/@muze-nl/metro-oldm/src/index.mjs
14244
14266
  globalThis.oldmmw = oldmmw;