@bbn/bbn 2.0.128 → 2.0.130

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/com.js CHANGED
@@ -70,10 +70,21 @@ const fetchRequest = (method, url, config = {}, aborter) => {
70
70
  const fetchPromise = fetch(url, fetchConfig).then((res) => __awaiter(void 0, void 0, void 0, function* () {
71
71
  let data;
72
72
  const contentType = res.headers.get('content-type') || '';
73
- if (contentType.includes('application/json')) {
74
- data = yield res.json();
73
+ try {
74
+ if (contentType.includes('application/json')) {
75
+ data = yield res.json();
76
+ }
77
+ else if (contentType.startsWith('text/')) {
78
+ data = yield res.text();
79
+ }
80
+ else if (contentType.includes("multipart/")) {
81
+ data = yield res.arrayBuffer();
82
+ }
83
+ else {
84
+ data = yield res.blob();
85
+ }
75
86
  }
76
- else {
87
+ catch (_a) {
77
88
  data = yield res.text();
78
89
  }
79
90
  const response = {
@@ -625,6 +625,10 @@ export default function parse(input, format, cls = 'auto', force, locale) {
625
625
  const d = new T.PlainMonthDay(ctx.month, ctx.day, 1972);
626
626
  dtObj = new bbnDtMonthDay(d);
627
627
  }
628
+ else if (isClsAuto && ctx.hasYear) {
629
+ const d = new T.PlainDate(ctx.year, 1, 1);
630
+ dtObj = new bbnDtDate(d);
631
+ }
628
632
  else {
629
633
  throw new Error('Not enough date components for a known Temporal type');
630
634
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "2.0.128",
3
+ "version": "2.0.130",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",