|
|
@ -43,7 +43,7 @@ module.exports = {
|
|
|
|
arrayEquals: (arr1, arr2) => arr1.length === arr2.length && arr1.slice().sort().every((value, index) => value === arr2.slice().sort()[index]),
|
|
|
|
arrayEquals: (arr1, arr2) => arr1.length === arr2.length && arr1.slice().sort().every((value, index) => value === arr2.slice().sort()[index]),
|
|
|
|
downloadTempS3: (file) => new Promise((resolve, reject) =>
|
|
|
|
downloadTempS3: (file) => new Promise((resolve, reject) =>
|
|
|
|
fetch(getS3url(file.randomId, file.mimetype))
|
|
|
|
fetch(getS3url(file.randomId, file.mimetype))
|
|
|
|
.then((f2) => f2.body.pipe(fs.createWriteStream(Path.join(__dirname, 'uploads/', file.originalname)).on('close', () => resolve())))
|
|
|
|
.then((f2) => f2.body.pipe(fs.createWriteStream(Path.join(__dirname, 'uploads/', sanitize(file.originalname))).on('close', () => resolve())))
|
|
|
|
.catch(reject)),
|
|
|
|
.catch(reject)),
|
|
|
|
getS3url,
|
|
|
|
getS3url,
|
|
|
|
getSafeExt,
|
|
|
|
getSafeExt,
|
|
|
|