Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(options: Options) {
super()
// null out ok flag for pre-populated services
this.services = createServiceList(options.services || [])
// allow strings instead of full {ip: string, port: ?number} object
this.candidates = (options.candidates || [])
.map(c => (typeof c === 'string' ? makeCandidate(c) : c))
.filter(c => this.services.every(s => s.ip !== c.ip))
this._browser = null
this._pollList = []
this._pollInterval = options.pollInterval || DEFAULT_POLL_INTERVAL
this._pollRequest = null
this._nameFilter = toRegex(santizeRe(options.nameFilter), TO_REGEX_OPTS)
this._ipFilter = toRegex(santizeRe(options.ipFilter), TO_REGEX_OPTS)
this._portFilter = [DEFAULT_PORT].concat(options.portFilter || [])
this._logger = options.logger
log(this._logger, 'silly', 'Created', this)
}
super()
// null out ok flag for pre-populated services
this.services = createServiceList(options.services || [])
// allow strings instead of full {ip: string, port: ?number} object
this.candidates = (options.candidates || [])
.map(c => (typeof c === 'string' ? makeCandidate(c) : c))
.filter(c => this.services.every(s => s.ip !== c.ip))
this._browser = null
this._pollList = []
this._pollInterval = options.pollInterval || DEFAULT_POLL_INTERVAL
this._pollRequest = null
this._nameFilter = toRegex(santizeRe(options.nameFilter), TO_REGEX_OPTS)
this._ipFilter = toRegex(santizeRe(options.ipFilter), TO_REGEX_OPTS)
this._portFilter = [DEFAULT_PORT].concat(options.portFilter || [])
this._logger = options.logger
log(this._logger, 'silly', 'Created', this)
}
function matches(fileName) {
return limit ? toRegex(limit, { contains: true }).exec(fileName) : true
}