Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import shuffle from 'fast-shuffle';
{
const d1 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
const d2: string[] = shuffle(d1);
const d3: string[] = shuffle(d1, () => 0.42);
}
{
const d1 = [
{ name: 'Alice', money: 10 },
{ name: 'Betty', money: 20 },
{ name: 'Cindy', money: 15 }
];
const d2: Array<{ name: string, money: number }> = shuffle(d1);
const d3: Array<{ name: string, money: number }> = shuffle(d1, () => 0.42);
}
import shuffle from 'fast-shuffle';
{
const d1 = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
const d2: string[] = shuffle(d1);
const d3: string[] = shuffle(d1, () => 0.42);
}
{
const d1 = [
{ name: 'Alice', money: 10 },
{ name: 'Betty', money: 20 },
{ name: 'Cindy', money: 15 }
];
const d2: Array<{ name: string, money: number }> = shuffle(d1);
const d3: Array<{ name: string, money: number }> = shuffle(d1, () => 0.42);
}
function shuffleFiles () {
const shuffleList = document.querySelectorAll('.js-item')
files = shuffle(files)
shuffleList.forEach((item, index) => {
const durations = [0.2, 0.35, 0.5]
item.style['animation-duration'] = `${durations[Math.floor(Math.random() * 3)]}s`
item.classList.add('shuffling')
})
setTimeout(() => {
renderFiles()
document.querySelector('#app').scrollTop = 0
}, 500)
}