Skip to content

Commit

Permalink
Fix if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
TaYaKi71751 committed Jul 31, 2024
1 parent 6f354be commit 915c57b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion url.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@
if(document.location.pathname.startsWith('/title')){
let jbv = undefined;
document.location.pathname.split('/').forEach((str) => {
if(str.length && (str.match(/^[0-9]+$/)[0] == str)){
if(
str.length &&
(() => {
let result = str.match(/^[0-9]+$/);
if(!result.length){
return [undefined];
} else {
return result;
}
})()[0] == str
){
jbv = str;
}
});
Expand Down

0 comments on commit 915c57b

Please sign in to comment.