Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

files-filters

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

files-filters - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

filters/glob.js

1

filters/exclude.js
'use strict';
var path = require('path');
var isDir = require('is-directory');

@@ -6,0 +5,0 @@ module.exports = function(re, method) {

@@ -6,9 +6,18 @@ 'use strict';

module.exports = function(extname) {
/**
* Match the given `extname`
*
* @param {String} extname
* @param {Boolean} `recurse` When `true` will also return directories matched before
* the actual condition is met, but necessary for nested dirs.
* @return {String}
*/
module.exports = function(extname, recurse) {
return function ext(fp, dir) {
if (typeof dir === 'string' && isDir(path.join(dir, fp))) {
if (recurse && typeof dir === 'string' && isDir(path.join(dir, fp))) {
return true;
}
return path.extname(fp) === extname;
}
};
};

@@ -5,2 +5,3 @@ 'use strict';

var isDir = require('is-directory');
var name = require('../utils/name');

@@ -15,3 +16,3 @@ module.exports = function(str, method) {

if (method && method === 'name') {
fp = path.basename(fp, path.extname(fp));
fp = name(fp);
} else if (method && Boolean(path[method])) {

@@ -21,3 +22,3 @@ fp = path[method](fp);

return fp === str;
}
};
};

@@ -16,3 +16,3 @@ 'use strict';

return re.test(fp);
}
};
};
'use strict';
var path = require('path');
var lookup = require('filter-files');

@@ -5,0 +4,0 @@ var camelize = require('../utils/camelize');

{
"name": "files-filters",
"description": "Functions for fantastically fast file filtering, and more things that start with 'f'.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/jonschlinkert/files-filters",

@@ -32,3 +32,3 @@ "author": {

"is-directory": "^0.2.2",
"multimatch": "^1.0.0"
"minimatch": "^1.0.0"
},

@@ -38,2 +38,3 @@ "devDependencies": {

"mocha": "*",
"should": "^4.1.0",
"verb": ">= 0.2.6",

@@ -40,0 +41,0 @@ "verb-tag-jscomments": ">= 0.2.0"

'use strict';
/**
* Coerce value to an flattened, dense array.
*
* @api private
*/
module.exports = function (val) {
module.exports = function arrayify(val) {
return Array.isArray(val) ? val : [val];
};
'use strict';
var path = require('path');
var name = require('./name');
module.exports = function camelize(fp) {
var str = path.basename(fp, path.extname(fp));
return str.replace(/-(.)/g, function (_, s) {
return name(fp).replace(/-(.)/g, function (_, s) {
return s.toUpperCase();
});
};

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

module.exports = function ext(filepath) {
return path.extname(filepath);
module.exports = function ext(fp) {
return path.extname(fp);
};

@@ -8,2 +8,16 @@ 'use strict';

// module.exports = {
// basename: require('./basename'),
// camelize: require('./camelize'),
// dirname: require('./dirname'),
// ext: require('./ext'),
// isDir: require('./is-dir'),
// isFile: require('./is-file'),
// method: require('./method'),
// name: require('./name'),
// normalize: require('./normalize'),
// segment: require('./segment'),
// };
lookup.sync(__dirname, false).forEach(function (name) {

@@ -10,0 +24,0 @@ var fp = path.resolve(__dirname, name);

'use strict';
var path = require('path');
var isDir = require('is-directory');
module.exports = function(fp, dir) {
fp = dir ? path.join(dir, fp) : fp;
module.exports = function(fp) {
return isDir(fp);
};
'use strict';
var path = require('path');
var isDir = require('is-directory');
module.exports = function isFile(fp, dir) {
fp = dir ? path.join(dir, fp) : fp;
module.exports = function isFile(fp) {
return !isDir(fp);
};
'use strict';
var re = /[\\\/]+/g;
module.exports = function normalize(files) {
if (typeof files === 'string') {
return files.replace(re, '/');
}
return files.map(function(fp) {
return fp.replace(/[\\\/]+/g, '/');
return fp.replace(re, '/');
}).sort();
};

Sorry, the diff of this file is not supported yet

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