Bumped to Node 24 and upgraded dependencies.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const fetch = require('node-fetch');
|
||||
const mime = require('mime');
|
||||
// const unprint = require('unprint');
|
||||
|
||||
@@ -28,6 +27,11 @@ async function fetchPredata() {
|
||||
}
|
||||
|
||||
function scrapeGallery(data, { predata }) {
|
||||
if (!data.gifs.length) {
|
||||
// Math.min() of an empty array is Infinity, which becomes an invalid date below
|
||||
return null;
|
||||
}
|
||||
|
||||
const oldestDate = Math.min(...data.gifs.map((gif) => gif.createDate));
|
||||
|
||||
const curated = {
|
||||
|
||||
Reference in New Issue
Block a user