Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const path = require('path');
const EventEmitter = require('events');
const {PassThrough} = require('stream');
const defaultIgnore = require('ignore-by-default').directories();
const lolex = require('lolex');
const proxyquire = require('proxyquire');
const sinon = require('sinon');
const {test} = require('tap');
const {normalizeGlobs} = require('../lib/globs');
const {setImmediate} = require('../lib/now-and-timers');
require('../lib/chalk').set({});
// Helper to make using beforeEach less arduous
function makeGroup(test) {
return (desc, fn) => {
test(desc, t => {
const beforeEach = fn => {
t.beforeEach(done => {
fn();
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const url = require('url');
const ignoredDirectories = require('ignore-by-default').directories();
const memoizee = require('memoizee');
const send = require('send');
const MAX_AGE = 1000 * 60 * 60 * 24 * 365; // 1 year in milliseconds
const SHORT_LEN = 7;
const LONG_LEN = 32;
const staticify = (root, options) => {
let sendOptsNonVersioned;
const setOptions = (opts = {}) => {
let defaultOptions = {
includeAll: opts.includeAll || false,
shortHash: opts.shortHash || true,
pathPrefix: opts.pathPrefix || '/',
maxAgeNonHashed: opts.maxAgeNonHashed || 0,
var ignoreRoot = require('ignore-by-default').directories();
// default options for config.options
module.exports = {
restartable: 'rs',
colours: true,
execMap: {
py: 'python',
rb: 'ruby',
ts: 'ts-node',
// more can be added here such as ls: lsc - but please ensure it's cross
// compatible with linux, mac and windows, or make the default.js
// dynamically append the `.cmd` for node based utilities
},
ignoreRoot: ignoreRoot.map(_ => `**/${_}/**`),
watch: ['*.*'],
stdin: true,
'use strict';
const fs = require('fs');
const path = require('path');
const Promise = require('bluebird');
const slash = require('slash');
const globby = require('globby');
const flatten = require('lodash.flatten');
const defaultIgnore = require('ignore-by-default').directories();
const multimatch = require('multimatch');
function handlePaths(files, extensions, excludePatterns, globOptions) {
// Convert Promise to Bluebird
files = Promise.resolve(globby(files.concat(excludePatterns), globOptions));
const searchedParents = new Set();
const foundFiles = new Set();
function alreadySearchingParent(dir) {
if (searchedParents.has(dir)) {
return true;
}
const parentDir = path.dirname(dir);