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

gitignore-globs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitignore-globs - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

8

index.js

@@ -24,5 +24,7 @@ 'use strict';

if (!isFile(pattern)) {
// Create pair of globs.
if (pattern.slice(-1) !== '/') {
var suffix = (pattern.slice(-1) == '*') ? '*' : '/**'
var suffix = (pattern.slice(-1) == '*') ? '*' : '/**';
if (pattern.slice(-1) === '/') {
pattern = [pattern + suffix];
} else {
// Create pair of globs.
pattern = [pattern, pattern + suffix];

@@ -29,0 +31,0 @@ }

{
"name": "gitignore-globs",
"version": "0.1.0",
"version": "0.1.1",
"description": "Parse a .gitignore file into an array of glob patterns.",

@@ -32,3 +32,3 @@ "main": "index.js",

"devDependencies": {
"chai": "^2.2.0",
"chai": "^2.2.0",
"mocha": "^2.2.4",

@@ -35,0 +35,0 @@ "multimatch": "^2.0.0"

@@ -55,2 +55,12 @@ var multimatch = require('multimatch');

it('should match dir', function() {
var files = ['/foo', '/foo/', 'bar', 'bar/foo', 'bar/foo/baz'];
var patterns = ['foo/'];
var globs = parse._map(patterns);
var result = multimatch(files, globs);
expect(result).to.eql(['/foo/', 'bar/foo/baz']);
});
it('should match glob pattern', function() {

@@ -57,0 +67,0 @@ var files = ['bar', 'foo/', 'foo/bar', 'foo/bar/baz'];

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