@orioro/util 0.13.1 → 0.14.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @orioro/util
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - syntheticJson fallback to full json in case of error
8
+
9
+ ## 0.13.2
10
+
11
+ ### Patch Changes
12
+
13
+ - undo export update
14
+
3
15
  ## 0.13.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1491,8 +1491,12 @@ function syntheticJson(str) {
1491
1491
  // Step 3: Parse as JSON
1492
1492
  try {
1493
1493
  return JSON.parse(normalized);
1494
- } catch (error) {
1495
- throw new Error("Invalid synthetic JSON: ".concat(str));
1494
+ } catch (err1) {
1495
+ try {
1496
+ return JSON.parse(str);
1497
+ } catch (err2) {
1498
+ throw new Error("Invalid synthetic JSON: ".concat(str));
1499
+ }
1496
1500
  }
1497
1501
  }
1498
1502
 
package/dist/index.mjs CHANGED
@@ -1489,8 +1489,12 @@ function syntheticJson(str) {
1489
1489
  // Step 3: Parse as JSON
1490
1490
  try {
1491
1491
  return JSON.parse(normalized);
1492
- } catch (error) {
1493
- throw new Error("Invalid synthetic JSON: ".concat(str));
1492
+ } catch (err1) {
1493
+ try {
1494
+ return JSON.parse(str);
1495
+ } catch (err2) {
1496
+ throw new Error("Invalid synthetic JSON: ".concat(str));
1497
+ }
1494
1498
  }
1495
1499
  }
1496
1500
 
package/package.json CHANGED
@@ -1,19 +1,13 @@
1
1
  {
2
2
  "name": "@orioro/util",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "packageManager": "yarn@4.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
- ".": {
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.js"
12
- },
13
- "./*": {
14
- "import": "./dist/*.mjs",
15
- "require": "./dist/*.js"
16
- }
9
+ ".": "./dist/index.mjs",
10
+ "./*": "./dist/*"
17
11
  },
18
12
  "files": [
19
13
  "dist"