@observertc/observer-js 1.0.0-beta.21 → 1.0.0-beta.22
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/index.d.mts +135 -40
- package/dist/index.d.ts +135 -40
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1411,17 +1411,19 @@ var ObservedInboundTrack = class {
|
|
|
1411
1411
|
function pushFinite(target, value) {
|
|
1412
1412
|
if (typeof value === "number" && Number.isFinite(value)) target.push(value);
|
|
1413
1413
|
}
|
|
1414
|
-
function parseJsonAs(
|
|
1415
|
-
if (
|
|
1414
|
+
function parseJsonAs(value) {
|
|
1415
|
+
if (value === void 0 || value === null || value === "") return void 0;
|
|
1416
|
+
if (typeof value === "object") return value;
|
|
1417
|
+
if (typeof value !== "string") return void 0;
|
|
1416
1418
|
try {
|
|
1417
|
-
return JSON.parse(
|
|
1419
|
+
return JSON.parse(value);
|
|
1418
1420
|
} catch {
|
|
1419
1421
|
return void 0;
|
|
1420
1422
|
}
|
|
1421
1423
|
}
|
|
1422
|
-
function parseJsonObject(
|
|
1423
|
-
const parsed = parseJsonAs(
|
|
1424
|
-
return typeof parsed === "object" && parsed !== null ? parsed : void 0;
|
|
1424
|
+
function parseJsonObject(value) {
|
|
1425
|
+
const parsed = parseJsonAs(value);
|
|
1426
|
+
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : void 0;
|
|
1425
1427
|
}
|
|
1426
1428
|
|
|
1427
1429
|
// src/ObservedOutboundTrack.ts
|