Skip to content

Commit 39a3e3d

Browse files
author
Mohamed Seleem
committed
Fix issues found by ebert
1 parent 26392ed commit 39a3e3d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/javascript/lib/core/erlang_compat/filename.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function join(arg, extra = null) {
55
const name = components[i];
66
const normalized_name = name.replace(/\/+/g, '/').replace(/^\/|\/$/g, '');
77
names.push(normalized_name);
8-
if (name[0] == '/') {
8+
if (name[0] === '/') {
99
names.push('');
1010
break;
1111
}
@@ -16,7 +16,7 @@ function join(arg, extra = null) {
1616
function dirname(arg) {
1717
const path = join([arg]);
1818
const index = path.lastIndexOf('/');
19-
return index == -1 ? '.' : path.substr(0, index) || '/';
19+
return index === -1 ? '.' : (path.substr(0, index) || '/');
2020
}
2121

2222
export default {

src/javascript/tests/core/erlang_compat/filename_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ test('join/1', (t) => {
2727
});
2828

2929
test('join/2', (t) => {
30-
let result = Core.filename.join('/usr', 'bin');
30+
const result = Core.filename.join('/usr', 'bin');
3131
t.is(result, '/usr/bin');
3232
});

0 commit comments

Comments
 (0)