style: auto-fix linting issues
This commit is contained in:
parent
bd7f77a103
commit
557a77d4f3
1 changed files with 15 additions and 13 deletions
|
|
@ -108,9 +108,11 @@ const syncManager = {
|
||||||
.replace(/\bNone\b/g, 'null');
|
.replace(/\bNone\b/g, 'null');
|
||||||
|
|
||||||
// Basic safety check: ensure it looks like a structure and doesn't contain obvious code vectors
|
// Basic safety check: ensure it looks like a structure and doesn't contain obvious code vectors
|
||||||
if ((jsFriendly.trim().startsWith('[') || jsFriendly.trim().startsWith('{')) &&
|
if (
|
||||||
!jsFriendly.match(/function|=>|window|document|alert|eval/)) {
|
(jsFriendly.trim().startsWith('[') || jsFriendly.trim().startsWith('{')) &&
|
||||||
return (new Function('return ' + jsFriendly))();
|
!jsFriendly.match(/function|=>|window|document|alert|eval/)
|
||||||
|
) {
|
||||||
|
return new Function('return ' + jsFriendly)();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -164,14 +166,14 @@ const syncManager = {
|
||||||
artists: item.artists?.map((a) => ({ id: a.id, name: a.name || null })) || [],
|
artists: item.artists?.map((a) => ({ id: a.id, name: a.name || null })) || [],
|
||||||
album: item.album
|
album: item.album
|
||||||
? {
|
? {
|
||||||
id: item.album.id,
|
id: item.album.id,
|
||||||
title: item.album.title || null,
|
title: item.album.title || null,
|
||||||
cover: item.album.cover || null,
|
cover: item.album.cover || null,
|
||||||
releaseDate: item.album.releaseDate || null,
|
releaseDate: item.album.releaseDate || null,
|
||||||
vibrantColor: item.album.vibrantColor || null,
|
vibrantColor: item.album.vibrantColor || null,
|
||||||
artist: item.album.artist || null,
|
artist: item.album.artist || null,
|
||||||
numberOfTracks: item.album.numberOfTracks || null,
|
numberOfTracks: item.album.numberOfTracks || null,
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
copyright: item.copyright || null,
|
copyright: item.copyright || null,
|
||||||
isrc: item.isrc || null,
|
isrc: item.isrc || null,
|
||||||
|
|
@ -192,8 +194,8 @@ const syncManager = {
|
||||||
artist: item.artist
|
artist: item.artist
|
||||||
? { name: item.artist.name || null, id: item.artist.id }
|
? { name: item.artist.name || null, id: item.artist.id }
|
||||||
: item.artists?.[0]
|
: item.artists?.[0]
|
||||||
? { name: item.artists[0].name || null, id: item.artists[0].id }
|
? { name: item.artists[0].name || null, id: item.artists[0].id }
|
||||||
: null,
|
: null,
|
||||||
type: item.type || null,
|
type: item.type || null,
|
||||||
numberOfTracks: item.numberOfTracks || null,
|
numberOfTracks: item.numberOfTracks || null,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue