Skip to content

Commit 848e6d4

Browse files
committed
Clean up rkey.ts
1 parent 892e9c1 commit 848e6d4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib/atproto/rkey.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ export function filepathToRkey(filepath: string) {
2323
// regex excludes : and _ because we use those as control characters
2424
// regex excludes ~ because using it gives us internal server error
2525
.replace(/[^A-Za-z0-9.\-]/g, $$ => {
26-
if ($$ == '\\' || $$ == '/') {
26+
if ($$ === '\\' || $$ === '/') {
2727
return ':';
28-
} else {
29-
return `_${$$.charCodeAt(0).toString(36)}_`;
3028
}
29+
return `_${$$.charCodeAt(0).toString(36)}_`;
3130
});
3231

3332
filepath = filepath.toLowerCase();

0 commit comments

Comments
 (0)