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

matcher-collection

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matcher-collection - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

index.d.ts

63

index.js
'use strict';
var Minimatch = require('minimatch').Minimatch;
module.exports = MatcherCollection;
function MatcherCollection(matchers) {
this.matchers = matchers.map(function(matcher) {
return typeof matcher === 'string' ? new Minimatch(matcher) : matcher;
});
}
MatcherCollection.prototype.match = function(value) {
for (var i = 0; i < this.matchers.length; i++) {
if (this.matchers[i].match(value)) {
return true;
var minimatch_1 = require("minimatch");
module.exports = /** @class */ (function () {
function MatcherCollection(matchers) {
this.matchers = matchers.map(function (matcher) {
return typeof matcher === 'string' ? new minimatch_1.Minimatch(matcher) : matcher;
});
}
}
return false;
};
MatcherCollection.prototype.mayContain = function(value) {
var parts = value.split(/\/|\\/g).filter(Boolean);
for (var i = 0; i < this.matchers.length; i++) {
var matcher = this.matchers[i];
for (var j = 0; j < matcher.set.length; j++) {
if (matcher.matchOne(parts, matcher.set[j], true)) {
return true;
}
}
}
return false;
};
MatcherCollection.prototype.match = function (value) {
for (var i = 0; i < this.matchers.length; i++) {
if (this.matchers[i].match(value)) {
return true;
}
}
return false;
};
MatcherCollection.prototype.mayContain = function (value) {
var parts = value.split(/\/|\\/g).filter(Boolean);
for (var i = 0; i < this.matchers.length; i++) {
var matcher = this.matchers[i];
for (var j = 0; j < matcher.set.length; j++) {
if (matcher.matchOne(parts, matcher.set[j], true)) {
return true;
}
}
}
return false;
};
;
return MatcherCollection;
}());
{
"name": "matcher-collection",
"version": "1.0.5",
"version": "1.1.0",
"main": "index.js",

@@ -9,10 +9,15 @@ "dependencies": {

"devDependencies": {
"tap": "^1.4.1"
"@types/minimatch": "^3.0.3",
"@types/node": "^10.12.21",
"tap": "^1.4.1",
"typescript": "~3.3.1"
},
"files": [
"index.js"
"index.js",
"index.d.ts"
],
"scripts": {
"test": "tap --timeout 2 test.js",
"test:debug": "tap --debug-brk --timeout 9999 test.js"
"build": "tsc -b .",
"test": "tsc -b . && tap --timeout 2 test.js",
"test:debug": "tsc -b . && tap --debug-brk --timeout 9999 test.js"
},

@@ -19,0 +24,0 @@ "author": "Stefan Penner",

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