+20
-5
@@ -14,9 +14,24 @@ 'use strict'; | ||
| var exists = node_fs.existsSync ? | ||
| function (file) { | ||
| return node_fs.existsSync(file); | ||
| } : | ||
| // if node <= 0.6, there's no fs.existsSync method. | ||
| function (file) { | ||
| try { | ||
| node_fs.statSync(file); | ||
| return true; | ||
| } catch(e) { | ||
| return false; | ||
| } | ||
| }; | ||
| // Select the first existing file of the file list | ||
| ignore.select = function (files) { | ||
| var exists; | ||
| var selected; | ||
| files.some(function (file) { | ||
| if( node_fs.existsSync(file) ){ | ||
| exists = file; | ||
| if( exists(file) ){ | ||
| selected = file; | ||
| return true; | ||
@@ -26,3 +41,3 @@ } | ||
| return exists; | ||
| return selected; | ||
| }; | ||
@@ -33,3 +48,3 @@ | ||
| // - ignore: {Array} | ||
| // - twoGlobstars: {boolean=false} enable pattern '`**`' (two consecutive asterisks), default to `false`. | ||
| // - twoGlobstars: {boolean=false} enable pattern `'**'` (two consecutive asterisks), default to `false`. | ||
| // If false, ignore patterns with two globstars will be omitted | ||
@@ -36,0 +51,0 @@ // - matchCase: {boolean=true} case sensitive. |
+1
-1
| { | ||
| "name": "ignore", | ||
| "version": "2.2.1", | ||
| "version": "2.2.7", | ||
| "description": "Ignore is a manager and filter for .gitignore rules.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+2
-0
@@ -0,2 +1,4 @@ | ||
| [](http://badge.fury.io/js/ignore) | ||
| [](https://travis-ci.org/kaelzhang/node-ignore) | ||
| [](https://gemnasium.com/kaelzhang/node-ignore) | ||
@@ -3,0 +5,0 @@ # ignore |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
21986
2.43%463
2.89%140
1.45%1
-50%