Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
"@rclnodejs/ref-array-di": "^1.2.2",
"@rclnodejs/ref-napi": "^4.0.0",
"@rclnodejs/ref-struct-di": "^1.1.1",
"array.prototype.flat": "^1.3.2",
"bindings": "^1.5.0",
"compare-versions": "^6.1.1",
"debug": "^4.4.0",
Expand Down
4 changes: 1 addition & 3 deletions rosidl_gen/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const readline = require('readline');
const path = require('path');
const walk = require('walk');
const os = require('os');
const flat = require('array.prototype.flat');
const pkgFilters = require('../rosidl_gen/filter.js');

const fsp = fs.promises;
Expand Down Expand Up @@ -193,8 +192,7 @@ async function findAmentPackagesInDirectory(dir) {
pkgs.map((pkg) => getPackageDefinitionsFiles(pkg, dir))
);

// Support flat() method for nodejs < 11.
const rosFiles = Array.prototype.flat ? files.flat() : flat(files);
const rosFiles = files.flat();
Copy link

Copilot AI Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By removing the dependency and conditional fallback, the code now assumes that Array.prototype.flat is always available. Please ensure the project's minimum Node.js version is set to 11 or higher to avoid runtime issues.

Copilot uses AI. Check for mistakes.
const pkgMap = new Map();
await Promise.all(
rosFiles.map((filePath) => addInterfaceInfos(filePath, dir, pkgMap))
Expand Down
Loading