Skip to content

Commit 7bd1f55

Browse files
authored
Remove dependency array.prototype.flat (#1049)
This patch removes dependency, `array.prototype.flat`, needed for nodejs prior to version 11. Fix: #1048
1 parent fad205e commit 7bd1f55

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
"@rclnodejs/ref-array-di": "^1.2.2",
6767
"@rclnodejs/ref-napi": "^4.0.0",
6868
"@rclnodejs/ref-struct-di": "^1.1.1",
69-
"array.prototype.flat": "^1.3.2",
7069
"bindings": "^1.5.0",
7170
"compare-versions": "^6.1.1",
7271
"debug": "^4.4.0",

rosidl_gen/packages.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const readline = require('readline');
2020
const path = require('path');
2121
const walk = require('walk');
2222
const os = require('os');
23-
const flat = require('array.prototype.flat');
2423
const pkgFilters = require('../rosidl_gen/filter.js');
2524

2625
const fsp = fs.promises;
@@ -193,8 +192,7 @@ async function findAmentPackagesInDirectory(dir) {
193192
pkgs.map((pkg) => getPackageDefinitionsFiles(pkg, dir))
194193
);
195194

196-
// Support flat() method for nodejs < 11.
197-
const rosFiles = Array.prototype.flat ? files.flat() : flat(files);
195+
const rosFiles = files.flat();
198196
const pkgMap = new Map();
199197
await Promise.all(
200198
rosFiles.map((filePath) => addInterfaceInfos(filePath, dir, pkgMap))

0 commit comments

Comments
 (0)