sync
This commit is contained in:
1 parent
84190ed9f1
commit
fb9e920c15
35 files changed
+3003
-1304
No files matched your search
@@ -22,7 +22,7 @@ export function getCookie(name) {
|
||||
const cookies = document.cookie.split(';');
|
||||
for (let cookie of cookies) {
|
||||
cookie = cookie.trim();
|
||||
if (cookie.indexOf(name) === 0) {
|
||||
if (cookie.startsWith(name)) {
|
||||
return decodeURIComponent(cookie.substring(name.length));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,16 +10,16 @@ export function contains(s, key, ignoreCase) {
|
||||
key = String(key);
|
||||
}
|
||||
if (ignoreCase) {
|
||||
return s.toLowerCase().indexOf(key.toLowerCase()) >= 0;
|
||||
return s.toLowerCase().includes(key.toLowerCase());
|
||||
}
|
||||
return s.indexOf(key) >= 0;
|
||||
return s.includes(key);
|
||||
}
|
||||
|
||||
export function endsWith(s, suffix) {
|
||||
if (nullOrEmpty(s) || nullOrEmpty(suffix)) {
|
||||
return false;
|
||||
}
|
||||
return s.indexOf(suffix) === s.length - suffix.length;
|
||||
return s.endsWith(suffix); // === s.length - suffix.length;
|
||||
}
|
||||
|
||||
export function padStart(s, num, char) {
|
||||
|
||||
Reference in new issue
Block a user