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

matcher

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 - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

16

index.js

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

function makeRe(pattern, shouldNegate, options) {
function makeRe(pattern, options) {
const opts = Object.assign({

@@ -12,3 +12,3 @@ caseSensitive: false

const cacheKey = pattern + shouldNegate + JSON.stringify(opts);
const cacheKey = pattern + JSON.stringify(opts);

@@ -27,6 +27,2 @@ if (reCache.has(cacheKey)) {

if (negated && shouldNegate) {
pattern = `(?!${pattern})`;
}
const re = new RegExp(`^${pattern}$`, opts.caseSensitive ? '' : 'i');

@@ -50,3 +46,3 @@ re.negated = negated;

patterns = patterns.map(x => makeRe(x, false, options));
patterns = patterns.map(x => makeRe(x, options));

@@ -73,2 +69,6 @@ const ret = [];

module.exports.isMatch = (input, pattern, options) => makeRe(pattern, true, options).test(input);
module.exports.isMatch = (input, pattern, options) => {
const re = makeRe(pattern, options);
const matches = re.test(input);
return re.negated ? !matches : matches;
};
{
"name": "matcher",
"version": "1.1.0",
"version": "1.1.1",
"description": "Simple wildcard matching",

@@ -5,0 +5,0 @@ "license": "MIT",

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