This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import path from 'path'; | |
import fs from 'fs'; | |
import os from 'os'; | |
import jwt from 'jsonwebtoken'; | |
import { getConfig } from '../../config'; | |
import mv from 'mv'; | |
import Error403 from '../../errors/Error403'; | |
/** | |
* The directory where the files should be uploaded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const models = require('../models'); | |
const SequelizeRepository = require('./sequelizeRepository'); | |
const AuditLogRepository = require('./auditLogRepository'); | |
const FileRepository = require('./fileRepository'); | |
const lodash = require('lodash'); | |
const SequelizeFilterUtils = require('../utils/sequelizeFilterUtils'); | |
const Sequelize = models.Sequelize; | |
const Op = Sequelize.Op; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NODE_PATH=src/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"javascript.updateImportsOnFileMove.enabled": "always", | |
"javascript.preferences.importModuleSpecifier": "non-relative" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"target": "es2016", | |
"jsx": "preserve", | |
"checkJs": true, | |
"baseUrl": "./src" | |
}, | |
"exclude": ["node_modules", "**/node_modules/*"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const seniorCandidatesRequirements = [ | |
// ... | |
]; | |
const candidates = [ | |
// ... | |
]; | |
function matchesEveryRequirement(candidates, requirements) { | |
if (!requirements) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const seniorCandidatesRequirements = [ | |
{ | |
matches(candidate) { | |
return Number(candidate.yearsOfExperience) >= 5; | |
} | |
}, | |
{ | |
matches(candidate) { | |
return candidate.languages && candidate.languages.includes('Javascript'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function selectSeniorCandidates(candidates) { | |
return candidates.filter(candidate => { | |
// with at least 5 years of experience that knows Javascript | |
return ( | |
candidate.yearsOfExperience >= 5 && | |
candidate.languages.includes('Javascript') | |
); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printPrimeNumbersFromZeroToHundred() { | |
const primeNumbersToPrint = primeNumbersBetween(0, 100); | |
console.log(primeNumbersToPrint); | |
} | |
function primeNumbersBetween(min, max) { | |
const result = []; | |
for (let i = min; i <= max; i++) { | |
if (isPrime(i)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function printPrimeNumbersFromZeroToHundred() { | |
const primeNumbers = []; | |
for (let i = 0; i <= 100; i++) { | |
if (isPrime(i)) { | |
primeNumbers.push(i); | |
} | |
} | |
console.log(primeNumbers); |
NewerOlder