mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -07:00
minor cleanup
This commit is contained in:
parent
376b386b31
commit
4ff068db0a
12 changed files with 63 additions and 28 deletions
|
@ -6,17 +6,27 @@ define(
|
|||
|
||||
return {
|
||||
|
||||
startsWith: function(str, starts){
|
||||
if (starts === '') return true;
|
||||
if (str == null || starts == null) return false;
|
||||
str = String(str); starts = String(starts);
|
||||
startsWith: function (str, starts) {
|
||||
if (starts === '') {
|
||||
return true;
|
||||
}
|
||||
if (str == null || starts == null) {
|
||||
return false;
|
||||
}
|
||||
str = String(str);
|
||||
starts = String(starts);
|
||||
return str.length >= starts.length && str.slice(0, starts.length) === starts;
|
||||
},
|
||||
|
||||
endsWith: function(str, ends){
|
||||
if (ends === '') return true;
|
||||
if (str == null || ends == null) return false;
|
||||
str = String(str); ends = String(ends);
|
||||
endsWith: function (str, ends) {
|
||||
if (ends === '') {
|
||||
return true;
|
||||
}
|
||||
if (str == null || ends == null) {
|
||||
return false;
|
||||
}
|
||||
str = String(str);
|
||||
ends = String(ends);
|
||||
return str.length >= ends.length && str.slice(str.length - ends.length) === ends;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue