Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_default: function stringDefault(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.green(s)
: colors.brightGreen(s)
}
}
_default: function(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.green(s)
: colors.brightGreen(s)
}
}
_default: function(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.green(s)
: colors.brightGreen(s)
}
}
_default: function(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.brightBlue(s)
: colors.brightGreen(s)
}
}
_default: function(s, info) {
var nextToken = info.tokens[info.tokenIndex + 1]
// show keys of object literals and json in different color
return (nextToken && nextToken.type === 'Punctuator' && nextToken.value === ':')
? colors.green(s)
: colors.brightGreen(s)
}
}
function readFile(entry, cb) {
fs.readFile(entry.fullPath, 'utf-8', function (err, res) {
if (err) return console.error(err);
cb(null, { fullPath: entry.fullPath, src: res });
});
}
function validate(opts, cb) {
validateRequires(opts.fullPath, opts.src, { redirect: redirect }, function (errors) {
cb(null, errors);
});
}
var errors = []
, notOk = colors.red('\u2639 ')
, ok = colors.brightGreen('\u00b7');
readdirp({ root: root, fileFilter: '*.js', directoryFilter: directoryFilter })
.on('error', function (err) {
cb(new Error('When reading ' + root + ':\n' + err.message));
})
.pipe(map(readFile))
.pipe(map(validate))
.on('data', function (data) {
process.stdout.write(data.length ? notOk : ok);
errors = errors.concat(data);
})
.on('end', function () {
cb(null, errors);
});
};
function formatAdd(key, value, diffopts) {
return format('%s %s: %s', colors.brightGreen('+'), key, diffValues({}, value, diffopts));
}
function reportWatchedFiles(watchers) {
log.println('Watching ' + colors.brightGreen('[' + Object.keys(watchers).length + ' files]'));
}