forked from DebaucheryLibrarian/traxxx
Removed upsert from store releases, observing effects; fixes ? inserted as . Removed query from stored Dogfart URLs.
This commit is contained in:
8
src/utils/pluck-photos.js
Normal file
8
src/utils/pluck-photos.js
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict';
|
||||
|
||||
// pick {photoLimit} photos evenly distributed photos from a set with {photoTotal} photos, return array of indexes starting at 1
|
||||
function pluckPhotos(photoTotal, photoLimit) {
|
||||
return [1].concat(Array.from({ length: photoLimit - 1 }, (value, index) => Math.floor((index + 1) * (photoTotal / (photoLimit - 1)))));
|
||||
}
|
||||
|
||||
module.exports = pluckPhotos;
|
||||
Reference in New Issue
Block a user