Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const loadPlaylist = async () => {
let data;
if (process.env.FLAVOR === 'cms') {
const response = await cms.getDraftPlaylist();
data = response.data;
} else {
const response = await fetch(`${settings.playlistsUrl}playlist.json`);
data = await response.json();
}
const playlist = data.playlist;
const megaGrid = data.megagrid
? shuffle(data.megagrid)
: null;
const list = [];
let megaGridIndex = 0;
for (let i = 0; i < layout.roomCount; i++) {
const entry = layout.insideMegaGrid(i)
? megaGrid
? megaGrid[megaGridIndex++ % megaGrid.length]
: null
: playlist.shift();
list.push(entry);
}
return list;
};
const { room } = this.context;
if (!room) return;
const count = room.frame.count;
if (!count) return;
return (
room &&
room.getHeadPosition(
index !== undefined
? (index + Math.floor(audio.totalProgress * 0.5)) % count
: count - 1
)
);
};
let time = 0;
const randomIndex = () => Math.floor(Math.random() * 100);
const compliments = shuffle([
'Nice moves.',
'Killer steps.',
'Sh.. Sh.. Shake it!',
'So elegant.',
'Remarkable.',
'You monster, you!',
'Cut that rug up!',
'Exactly!',
'Yes!',
'You the best!',
'Yes. Yes. Yes!',
'Get your freak on.',
'Loved this bit.',
'E-l-e-c-t-r-i-f-y-i-n-g!',
'Put that foot down.',
'Get down with it.',