mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
1 parent
efc9cf7362
commit
6715bc457a
16 files changed
+268
-267
No files matched your search
@@ -2,8 +2,12 @@ export function clamp(num, a, b) {
|
||||
return Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));
|
||||
}
|
||||
|
||||
export function capitalize(str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
}
|
||||
|
||||
export function secondToTime(second) {
|
||||
const add0 = num => (num < 10 ? `0${num}` : String(num));
|
||||
const add0 = (num) => (num < 10 ? `0${num}` : String(num));
|
||||
const hour = Math.floor(second / 3600);
|
||||
const min = Math.floor((second - hour * 3600) / 60);
|
||||
const sec = Math.floor(second - hour * 3600 - min * 60);
|
||||
@@ -13,7 +17,7 @@ export function secondToTime(second) {
|
||||
export function escape(str) {
|
||||
return str.replace(
|
||||
/[&<>'"]/g,
|
||||
tag =>
|
||||
(tag) =>
|
||||
({
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
|
||||
Reference in new issue
Block a user