fix lingering linting errors

This commit is contained in:
Cassie Tarakajian 2017-06-13 16:47:36 -04:00
parent 2e62c6b288
commit 1ae37ebaaa
6 changed files with 11 additions and 10 deletions

View file

@ -28,7 +28,7 @@ export function getObjectKey(url) {
if (urlArray.length === 6) { if (urlArray.length === 6) {
const key = urlArray.pop(); const key = urlArray.pop();
const userId = urlArray.pop(); const userId = urlArray.pop();
objectKey = `${userId}/${key}` objectKey = `${userId}/${key}`;
} else { } else {
const key = urlArray.pop(); const key = urlArray.pop();
objectKey = key; objectKey = key;

View file

@ -48,7 +48,8 @@ function deleteMany(files, ids) {
each(ids, (id, cb) => { each(ids, (id, cb) => {
if (files.id(id).url) { 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); const objectKey = getObjectKey(files.id(id).url);
objectKeys.push(objectKey); objectKeys.push(objectKey);
} }

View file

@ -100,9 +100,7 @@ function deleteFilesFromS3(files) {
} }
return false; return false;
}) })
.map((file) => { .map(file => getObjectKey(file.url))
return getObjectKey(file.url);
})
); );
} }

View file

@ -112,7 +112,8 @@ function getSketchContent(projectsInAllCategories) {
if (noNumberprojectName === 'Instance Mode : Instance Container ') { if (noNumberprojectName === 'Instance Mode : Instance Container ') {
for (let i = 0; i < 4; i += 1) { for (let i = 0; i < 4; i += 1) {
const splitedRes = `${res.split('*/')[1].split('</html>')[i]}</html>\n`; const splitedRes = `${res.split('*/')[1].split('</html>')[i]}</html>\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 { } else {
project.sketchContent = res; 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) => { assetsInProject.forEach((assetNamePath, i) => {
let assetName = assetNamePath.split('assets/')[1]; let assetName = assetNamePath.split('assets/')[1];

View file

@ -1,5 +1,5 @@
import { resolvePathToFile } from '../utils/filePath'; 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 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 STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm;
const EXTERNAL_LINK_REGEX = /^(http:\/\/|https:\/\/)/; const EXTERNAL_LINK_REGEX = /^(http:\/\/|https:\/\/)/;

@ -1 +1 @@
Subproject commit 5b924f3460886b82d72d0ab0d709f323f8b9a588 Subproject commit 0958be54482722821159cd3e07777988ee349f37