• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RobotWebTools / rclnodejs / 18834767018
81%

Build:
DEFAULT BRANCH: develop
Ran 27 Oct 2025 08:47AM UTC
Jobs 1
Files 42
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Oct 2025 08:36AM UTC coverage: 81.795% (-0.8%) from 82.578%
18834767018

push

github

web-flow
Add JSON-Safe serialization modes (#1308)

## **Public API Changes**

**New subscription option:**
- `serializationMode: 'default' | 'plain' | 'json'` for `createSubscription()`

**New utility functions:**  
- `rclnodejs.toJSONSafe(obj)` - makes objects JSON-friendly
- `rclnodejs.toJSONString(obj)` - converts directly to JSON string

**Fully backward compatible** - existing code works unchanged.

## **Description**

This adds **message serialization modes** to fix a common headache: ROS sensor messages use `TypedArray`s which don't play nice with JSON.

**The Problem:**
If you try to `JSON.stringify()` a LaserScan message, you get `{}` instead of the actual data. This breaks web APIs, logging, and any workflow that needs JSON.

**The Solution:**
Three modes to handle messages differently:

- **`'default'`** Uses native rclnodejs behavior
- **`'plain'`**: Convert TypedArrays to regular arrays - JSON works!  
- **`'json'`**: Handle everything (TypedArrays, BigInt, NaN) - fully JSON-safe


[#1307](https://github.com/RobotWebTools/rclnodejs/issues/1307)

859 of 1164 branches covered (73.8%)

Branch coverage included in aggregate %.

35 of 57 new or added lines in 3 files covered. (61.4%)

2057 of 2401 relevant lines covered (85.67%)

403.62 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
94.74
-5.26% lib/subscription.js
21
54.9
lib/message_serialization.js
Jobs
ID Job ID Ran Files Coverage
1 run-push-24.X-x64 - 18834767018.1 27 Oct 2025 08:47AM UTC 42
81.8
GitHub Action Run
Source Files on build 18834767018
  • Tree
  • List 42
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #18834767018
  • 525fba16 on github
  • Prev Build on develop (#18642232469)
  • Next Build on develop (#18868049146)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc