Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fileExistsSync(
path.resolve(`./node_modules/${PLATFORM_PACKAGE}/package.json`)
)
) {
// double check they have the right version installed
const installedPkgVersion = require(path.resolve(
`./node_modules/${PLATFORM_PACKAGE}/package.json`
)).version;
if (requiredVersion !== installedPkgVersion) {
versions.push(
`${colors.yellow('\nWarning!')} Required version (${colors.green(
requiredVersion
)}) and installed version (${colors.green(
installedPkgVersion
)}) are out of sync. Run ${colors.cyan('`npm install`')} to fix.\n`
);
}
}
}
}
context.line(versions.join('\n'));
};
!reporterOptions.noAssertions && emitter.on('assertion', function (err, o) {
var passed = !err;
// handle skipped test display
if (o.skipped && !reporterOptions.noSuccessAssertions) {
print.lf('%s %s', colors.cyan(' - '), colors.cyan('[skipped] ' + o.assertion));
return;
}
if (passed && reporterOptions.noSuccessAssertions) {
return;
}
// print each test assertions
print.lf('%s %s', passed ? colors.green(` ${symbols.ok} `) :
colors.red.bold(pad(this.summary.run.failures.length, 3, SPC) + symbols.dot), passed ?
colors.gray(o.assertion) : colors.red.bold(o.assertion));
});
function getLinks(phantom, url, callback) {
console.log(colors.green("Phantom attempting to load ") + colors.cyan("%s"), url);
makePage(phantom, url, function(page, status) {
console.log(
colors.green("Phantom opened URL with %s — ") + colors.cyan("%s"), status, url);
page.evaluate(findPageLinks, function(result) {
result.forEach(function(url) {
crawler.queueURL(url);
});
callback();
});
});
}
var processors = [
autoprefixer({browsers: [
'last 1 version',
'last 2 Chrome versions',
'last 2 Firefox versions',
'last 2 Opera versions',
'last 2 Edge versions'
]}),
mqpacker()
];
console.log('⬤ Run ' + colors.yellow('Sass') +
' + ' +
colors.green('Autoprefixer') +
' + ' +
colors.cyan('Cssnano') + ' ⬤'
);
return gulp.src('src/scss/styles.scss')
.pipe(sass().on('error', sass.logError))
.pipe(postcss(processors))
.pipe(gulp.dest('./assets/css'))
.pipe(sync.stream())
.pipe(postcss([cssnano()]))
.pipe(rename('styles.min.css'))
.pipe(gulp.dest('assets/css'));
});
function logQueryResult(results) {
console.log(colors.cyan(JSON.stringify(results)));
}
zip.addLocalFile(filename);
countFilesToTranslate++;
});
zip.writeZip(commander.output);
if (commander.keep !== true) {
rimraf(commander.temp, function(err) {
if (err) {
console.log(colors.red('Error: Unable to remove temporary directory.'));
}
});
}
console.log('Files inspected: ', countAllFiles);
console.log('Files to translate: ', colors.green(countFilesToTranslate));
console.log('ZIP file created: ', colors.cyan(commander.output));
}
challenge.save().then(solvedChallenge => {
solvedChallenge.description = entities.decode(sanitizeHtml(solvedChallenge.description, {
allowedTags: [],
allowedAttributes: []
}))
logger.info(colors.green('Solved') + ' challenge ' + colors.cyan(solvedChallenge.name) + ' (' + solvedChallenge.description + ')')
self.sendNotification(solvedChallenge, isRestore)
})
}
private async _visitMethod(symbol: ts.Symbol, type: spec.ClassType | spec.InterfaceType, ctx: EmitContext) {
if (LOG.isTraceEnabled()) {
LOG.trace(`Processing method: ${colors.green(type.fqn)}#${colors.cyan(symbol.name)}`);
}
const declaration = symbol.valueDeclaration as (ts.MethodDeclaration | ts.MethodSignature);
const signature = this._typeChecker.getSignatureFromDeclaration(declaration);
if (!signature) {
this._diagnostic(declaration, ts.DiagnosticCategory.Error, `Unable to compute signature for ${type.fqn}#${symbol.name}`);
return;
}
if (isProhibitedMemberName(symbol.name)) {
this._diagnostic(declaration, ts.DiagnosticCategory.Error, `Prohibited member name: ${symbol.name}`);
return;
}
this._warnAboutReservedWords(symbol);
const parameters = await Promise.all(signature.getParameters().map(p => this._toParameter(p, ctx)));
var time = new tt.Moment("00:00:00", "HH:mm:ss").add(result, "seconds");
var color = colors.green;
if (result >= restSecondsToWorkThisDay){
color = colors.cyan;
if (restSecondsToWorkThisDay > 0 && result > 0){
tt.log(color("Time elapsed:"), color(date), color("-"), color(time.format("HH:mm:ss")), color("You are done for this day ;O)"));
} else {
tt.log(color("Time elapsed:"), color(date), color("-"), color(time.format("HH:mm:ss")));
}
} else {
var canWorkUntil = new tt.Moment(date + " " + tt.time.toString(), "DD.MM.YYYY HH:mm:ss").add(restSecondsToWorkThisDay - result, "seconds");
tt.log(colors.bold.yellow("Elapsed time on " + date + ": ") + colors.cyan(time.format("HH:mm:ss")));
tt.log(colors.bold.yellow("Expected end-time: ") + colors.cyan(canWorkUntil.format("dddd, MMMM Do YYYY, HH:mm:ss")));
}
return result;
};