Skip to content

Commit f8779bb

Browse files
committed
Address comments
1 parent b90b0b8 commit f8779bb

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/action/uuid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ActionUuid {
4040
this._bytes = bytes;
4141
} else {
4242
// Generate random UUID.
43-
let uuid = randomUUID().replace(/-/g, '');
43+
let uuid = randomUUID().replaceAll('-', '');
4444
this._bytes = Uint8Array.from(Buffer.from(uuid, 'hex'));
4545
}
4646
}

rosidl_gen/packages.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const serviceMsgPath = path.join(generatedRoot, 'srv_msg');
2929

3030
function getPackageName(filePath, amentExecuted) {
3131
if (os.type() === 'Windows_NT') {
32-
filePath = filePath.replace(/\\/g, '/');
32+
filePath = filePath.replaceAll('\\', '/');
3333
}
3434

3535
if (amentExecuted) {
@@ -41,14 +41,14 @@ function getPackageName(filePath, amentExecuted) {
4141

4242
// If |packageName| equals to the file's extension, e.g. msg/srv, one level
4343
// up directory will be used as the package name.
44-
return packageName === path.parse(filePath).ext.substr(1)
44+
return packageName === path.parse(filePath).ext.substring(1)
4545
? folders.pop()
4646
: packageName;
4747
}
4848

4949
function getSubFolder(filePath, amentExecuted) {
5050
if (os.type() === 'Windows_NT') {
51-
filePath = filePath.replace(/\\/g, '/');
51+
filePath = filePath.replaceAll('\\', '/');
5252
}
5353

5454
if (amentExecuted) {

rosidl_gen/templates/message-template.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ const typedArrayType = [
156156
];
157157

158158
function isPrimitivePackage(baseType) {
159-
return primitiveBaseType.indexOf(baseType.type) !== -1;
159+
return primitiveBaseType.includes(baseType.type);
160160
}
161161

162162
function isTypedArrayType(type) {
163-
return typedArrayType.indexOf(type.type.toLowerCase()) !== -1;
163+
return typedArrayType.includes(type.type.toLowerCase());
164164
}
165165

166166
function isBigInt(type) {

scripts/run_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ utils
2727
const testDir = path.join(__dirname, '../test/');
2828
// eslint-disable-next-line
2929
const tests = fs.readdirSync(testDir).filter((file) => {
30-
return file.substr(0, 5) === 'test-';
30+
return file.startsWith('test-');
3131
});
3232

3333
// eslint-disable-next-line
@@ -37,7 +37,7 @@ utils
3737
let ignoredCases = blocklist[os.type()];
3838

3939
tests.forEach((test) => {
40-
if (ignoredCases.indexOf(test) === -1) {
40+
if (!ignoredCases.includes(test)) {
4141
mocha.addFile(path.join(testDir, test));
4242
}
4343
});

0 commit comments

Comments
 (0)