diff --git a/server/controllers/aws.controller.js b/server/controllers/aws.controller.js index eda6b4c3..a22be355 100644 --- a/server/controllers/aws.controller.js +++ b/server/controllers/aws.controller.js @@ -28,12 +28,12 @@ export function getObjectKey(url) { if (urlArray.length === 6) { const key = urlArray.pop(); const userId = urlArray.pop(); - objectKey = `${userId}/${key}` + objectKey = `${userId}/${key}`; } else { const key = urlArray.pop(); objectKey = key; } - return objectKey; + return objectKey; } export function deleteObjectsFromS3(keyList, callback) { diff --git a/server/controllers/file.controller.js b/server/controllers/file.controller.js index a6bc7d51..06f3ff68 100644 --- a/server/controllers/file.controller.js +++ b/server/controllers/file.controller.js @@ -48,7 +48,8 @@ function deleteMany(files, ids) { each(ids, (id, cb) => { if (files.id(id).url) { - if (!process.env.S3_DATE || (process.env.S3_DATE && moment(process.env.S3_DATE) < moment(files.id(id).createdAt))) { + if (!process.env.S3_DATE + || (process.env.S3_DATE && moment(process.env.S3_DATE) < moment(files.id(id).createdAt))) { const objectKey = getObjectKey(files.id(id).url); objectKeys.push(objectKey); } diff --git a/server/controllers/project.controller.js b/server/controllers/project.controller.js index 84b2afa1..cdfb0ac1 100644 --- a/server/controllers/project.controller.js +++ b/server/controllers/project.controller.js @@ -100,9 +100,7 @@ function deleteFilesFromS3(files) { } return false; }) - .map((file) => { - return getObjectKey(file.url); - }) + .map(file => getObjectKey(file.url)) ); } diff --git a/server/examples.js b/server/examples.js index bb23c333..341fa409 100644 --- a/server/examples.js +++ b/server/examples.js @@ -112,7 +112,8 @@ function getSketchContent(projectsInAllCategories) { if (noNumberprojectName === 'Instance Mode : Instance Container ') { for (let i = 0; i < 4; i += 1) { const splitedRes = `${res.split('*/')[1].split('')[i]}\n`; - project.sketchContent = splitedRes.replace('p5.js', 'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.4/p5.min.js'); + project.sketchContent = splitedRes.replace('p5.js', + 'https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.4/p5.min.js'); } } else { project.sketchContent = res; @@ -228,7 +229,8 @@ function createProjectsInP5user(projectsInAllCategories) { }); } - const assetsInProject = project.sketchContent.match(/assets\/[\w-]+\.[\w]*/g) || project.sketchContent.match(/assets\/[\w-]*/g) || []; + const assetsInProject = project.sketchContent.match(/assets\/[\w-]+\.[\w]*/g) + || project.sketchContent.match(/assets\/[\w-]*/g) || []; assetsInProject.forEach((assetNamePath, i) => { let assetName = assetNamePath.split('assets/')[1]; diff --git a/server/utils/previewGeneration.js b/server/utils/previewGeneration.js index 5b44d41a..983f1f9c 100644 --- a/server/utils/previewGeneration.js +++ b/server/utils/previewGeneration.js @@ -1,5 +1,5 @@ import { resolvePathToFile } from '../utils/filePath'; - +// eslint-disable-next-line max-len const MEDIA_FILE_REGEX_NO_QUOTES = /^(?!(http:\/\/|https:\/\/)).*\.(png|jpg|jpeg|gif|bmp|mp3|wav|aiff|ogg|json|txt|csv|svg|obj|mp4|ogg|webm|mov|otf|ttf|m4a)$/i; const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm; const EXTERNAL_LINK_REGEX = /^(http:\/\/|https:\/\/)/; diff --git a/static/p5-interceptor b/static/p5-interceptor index 5b924f34..0958be54 160000 --- a/static/p5-interceptor +++ b/static/p5-interceptor @@ -1 +1 @@ -Subproject commit 5b924f3460886b82d72d0ab0d709f323f8b9a588 +Subproject commit 0958be54482722821159cd3e07777988ee349f37