Socket
Socket
Sign inDemoInstall

nanomatch

Package Overview
Dependencies
60
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.1.0

10

CHANGELOG.md

@@ -14,2 +14,12 @@ ## History

### [1.1.0] - 2017-04-11
**Fixed**
- adds support for unclosed quotes
**Added**
- adds support for `options.noglobstar`
### [1.0.4] - 2017-04-06

@@ -16,0 +26,0 @@

16

lib/parsers.js

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

var pos = this.position();
var m = this.match(/^["']/);
var m = this.match(/^(["'])(?=.*\1)/);
if (!m) return;
var quote = m[0];
var quote = m[1];
var tok = advanceTo(this.input, quote);

@@ -164,6 +164,12 @@ this.consume(tok.len);

nanomatch.state.metachar = true;
return pos({
var node = pos({
type: 'globstar',
val: '**'
});
if (this.options.noglobstar === true) {
node.type = 'star';
node.val = '*';
}
return node;
})

@@ -326,6 +332,2 @@

if (ch !== endChar) {
throw new Error('unclosed: ' + endChar);
}
tok.val = val;

@@ -332,0 +334,0 @@ return tok;

{
"name": "nanomatch",
"description": "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)",
"version": "1.0.4",
"version": "1.1.0",
"homepage": "https://github.com/jonschlinkert/nanomatch",

@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

@@ -24,2 +24,3 @@ # nanomatch [![NPM version](https://img.shields.io/npm/v/nanomatch.svg?style=flat)](https://www.npmjs.com/package/nanomatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/nanomatch.svg?style=flat)](https://npmjs.org/package/nanomatch) [![NPM total downloads](https://img.shields.io/npm/dt/nanomatch.svg?style=flat)](https://npmjs.org/package/nanomatch) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/nanomatch.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/nanomatch) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/nanomatch.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/nanomatch)

* [options.nodupes](#optionsnodupes)
* [options.noglobstar](#optionsnoglobstar)
* [options.nonegate](#optionsnonegate)

@@ -29,2 +30,3 @@ * [options.nonull](#optionsnonull)

* [options.snapdragon](#optionssnapdragon)
* [options.sourcemap](#optionssourcemap)
* [options.unescape](#optionsunescape)

@@ -62,2 +64,12 @@ * [options.unixify](#optionsunixify)

### [1.1.0](https://github.com/jonschlinkert/nanomatch/compare/1.0.4...1.1.0) - 2017-04-11
**Fixed**
* adds support for unclosed quotes
**Added**
* adds support for `options.noglobstar`
### [1.0.4](https://github.com/jonschlinkert/nanomatch/compare/1.0.3...1.0.4) - 2017-04-06

@@ -203,5 +215,2 @@

<details>
<summary><strong>nanomatch</strong></summary>
### [nanomatch](index.js#L31)

@@ -228,4 +237,2 @@

</details>
<details>

@@ -717,3 +724,3 @@ <summary><strong>.match</strong></summary>

Default: `undefined`
Default: `true` (enabled by default)

@@ -725,7 +732,28 @@ **Example**

```js
nm.match(['a/b/c', 'a/b/c'], 'a/b/c');
nm.match(['a/b/c', 'a/b/c'], '**');
//=> ['abc']
nm.match(['a/b/c', 'a/b/c'], '**', {nodupes: false});
//=> ['a/b/c', 'a/b/c']
```
nm.match(['a/b/c', 'a/b/c'], 'a/b/c', {nodupes: true});
//=> ['abc']
</details>
<details>
<summary><strong>nonegate</strong></summary>
### options.noglobstar
Disable matching with globstars (`**`).
Type: `Boolean`
Default: `undefined`
```js
nm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**');
//=> ['a/b', 'a/b/c', 'a/b/c/d']
nm(['a/b', 'a/b/c', 'a/b/c/d'], 'a/**', {noglobstar: true});
//=> ['a/b']
```

@@ -784,2 +812,34 @@

<details>
<summary><strong>snapdragon</strong></summary>
### options.sourcemap
Generate a source map by enabling the `sourcemap` option with the `.parse`, `.compile`, or `.create` methods.
**Examples**
``` js
var nm = require('nanomatch');
var res = nm.create('abc/*.js', {sourcemap: true});
console.log(res.map);
// { version: 3,
// sources: [ 'string' ],
// names: [],
// mappings: 'AAAA,GAAG,EAAC,iBAAC,EAAC,EAAE',
// sourcesContent: [ 'abc/*.js' ] }
var ast = nm.parse('abc/**/*.js');
var res = nm.compile(ast, {sourcemap: true});
console.log(res.map);
// { version: 3,
// sources: [ 'string' ],
// names: [],
// mappings: 'AAAA,GAAG,EAAC,2BAAE,EAAC,iBAAC,EAAC,EAAE',
// sourcesContent: [ 'abc/**/*.js' ] }
```
</details>
<details>
<summary><strong>unescape</strong></summary>

@@ -870,3 +930,3 @@

| [expand-brackets](https://github.com/jonschlinkert/expand-brackets) | Brackets | `[[:alpha:]]` | [POSIX character classes](https://www.gnu.org/software/grep/manual/html_node/Character-Classes-and-Bracket-Expressions.html) (also referred to as POSIX brackets, or POSIX character classes) |
| [extglob](https://github.com/jonschlinkert/extglob) | Parens | `!(a | b)` | [Extglobs](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html#Pattern-Matching) |
| [extglob](https://github.com/jonschlinkert/extglob) | Parens | `!(a\|b)` | [Extglobs](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html#Pattern-Matching) |
| [micromatch](https://github.com/jonschlinkert/micromatch) | All | all | Micromatch is built on top of the other libraries. |

@@ -976,2 +1036,2 @@

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 09, 2017._
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 11, 2017._
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc