Socket
Socket
Sign inDemoInstall

mocha

Package Overview
Dependencies
Maintainers
1
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha - npm Package Compare versions

Comparing version 5.0.3 to 5.0.4

47

lib/utils.js

@@ -11,4 +11,11 @@ 'use strict';

var path = require('path');
var join = path.join;
var he = require('he');
/**
* Ignored directories.
*/
var ignore = ['node_modules', '.git'];
exports.inherits = require('util').inherits;

@@ -59,2 +66,42 @@

/**
* Ignored files.
*
* @api private
* @param {string} path
* @return {boolean}
*/
function ignored (path) {
return !~ignore.indexOf(path);
}
/**
* Lookup files in the given `dir`.
*
* @api private
* @param {string} dir
* @param {string[]} [ext=['.js']]
* @param {Array} [ret=[]]
* @return {Array}
*/
exports.files = function (dir, ext, ret) {
ret = ret || [];
ext = ext || ['js'];
var re = new RegExp('\\.(' + ext.join('|') + ')$');
fs.readdirSync(dir)
.filter(ignored)
.forEach(function (path) {
path = join(dir, path);
if (fs.lstatSync(path).isDirectory()) {
exports.files(path, ext, ret);
} else if (path.match(re)) {
ret.push(path);
}
});
return ret;
};
/**
* Compute a slug from the given `str`.

@@ -61,0 +108,0 @@ *

2

package.json
{
"name": "mocha",
"version": "5.0.3",
"version": "5.0.4",
"description": "simple, flexible, fun test framework",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc