diff options
Diffstat (limited to 'node_modules/nanomatch')
20 files changed, 425 insertions, 1000 deletions
diff --git a/node_modules/nanomatch/LICENSE b/node_modules/nanomatch/LICENSE index b11cb7968..717ee8b55 100644 --- a/node_modules/nanomatch/LICENSE +++ b/node_modules/nanomatch/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016-2017, Jon Schlinkert +Copyright (c) 2016-2017, Jon Schlinkert. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/nanomatch/README.md b/node_modules/nanomatch/README.md index b3579b4da..f6ada2fbf 100644 --- a/node_modules/nanomatch/README.md +++ b/node_modules/nanomatch/README.md @@ -2,9 +2,14 @@ > 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) +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Table of Contents + <details> -<summary><strong>Table of Contents</strong></summary> +<summary><strong>Details</strong></summary> +- [Install](#install) - [What is nanomatch?](#what-is-nanomatch) - [Getting started](#getting-started) * [Installing nanomatch](#installing-nanomatch) @@ -36,14 +41,17 @@ * [Running benchmarks](#running-benchmarks) * [Latest results](#latest-results) - [About](#about) - * [Related projects](#related-projects) - * [Contributing](#contributing) - * [Running tests](#running-tests) - * [Author](#author) - * [License](#license) </details> +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save nanomatch +``` + <details> <summary><strong>Release history</strong></summary> @@ -128,7 +136,7 @@ Nanomatch uses [snapdragon](https://github.com/jonschlinkert/snapdragon) for par Nanomatch supports [basic globbing only](#features), which is limited to `*`, `**`, `?` and regex-like brackets. -If you need support for the other [bash "expansion" types](#bash-expansion-libs) (in addition to the wildcard matching provided by nanomatch), consider using [micromatch](https://github.com/jonschlinkert/micromatch) instead. _(micromatch >=3.0.0 uses the nanomatch parser and compiler for basic glob matching)_ +If you need support for the other [bash "expansion" types](#bash-expansion-libs) (in addition to the wildcard matching provided by nanomatch), consider using [micromatch](https://github.com/micromatch/micromatch) instead. _(micromatch >=3.0.0 uses the nanomatch parser and compiler for basic glob matching)_ </details> @@ -485,7 +493,30 @@ console.log(isMatch('a.b')); //=> true ``` -### [.makeRe](index.js#L553) +### [.capture](index.js#L560) + +Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match. + +**Params** + +* `pattern` **{String}**: Glob pattern to use for matching. +* `string` **{String}**: String to match +* `options` **{Object}**: See available [options](#options) for changing how matches are performed +* `returns` **{Boolean}**: Returns an array of captures if the string matches the glob pattern, otherwise `null`. + +**Example** + +```js +var nm = require('nanomatch'); +nm.capture(pattern, string[, options]); + +console.log(nm.capture('test/*.js', 'test/foo.js')); +//=> ['foo'] +console.log(nm.capture('test/*.js', 'foo/bar.css')); +//=> null +``` + +### [.makeRe](index.js#L595) Create a regular expression from the given glob `pattern`. @@ -505,7 +536,7 @@ console.log(nm.makeRe('*.js')); //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ ``` -### [.create](index.js#L616) +### [.create](index.js#L662) Parses the given glob `pattern` and returns an object with the compiled `output` and optional source `map`. @@ -547,7 +578,7 @@ console.log(nm.create('abc/*.js')); // idx: 6 } ``` -### [.parse](index.js#L655) +### [.parse](index.js#L701) Parse the given `str` with the given `options`. @@ -580,7 +611,7 @@ console.log(ast); // { type: 'eos', val: '' } ] } ``` -### [.compile](index.js#L703) +### [.compile](index.js#L749) Compile the given `ast` or string with the given `options`. @@ -614,7 +645,7 @@ console.log(nm.compile(ast)); // parsingErrors: [] } ``` -### [.clearCache](index.js#L726) +### [.clearCache](index.js#L772) Clear the regex cache. @@ -946,7 +977,7 @@ The following extended-globbing features are not supported: * [extglobs](https://github.com/jonschlinkert/extglob) (e.g. `@(a|!(c|d))`) * [POSIX brackets](https://github.com/jonschlinkert/expand-brackets) (e.g. `[[:alpha:][:digit:]]`) -If you need any of these features consider using [micromatch](https://github.com/jonschlinkert/micromatch) instead. +If you need any of these features consider using [micromatch](https://github.com/micromatch/micromatch) instead. ## Bash expansion libs @@ -959,7 +990,7 @@ Nanomatch is part of a suite of libraries aimed at bringing the power and expres | [braces](https://github.com/jonschlinkert/braces) | Braces | `{a,b,c}` | [Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) | | [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) | -| [micromatch](https://github.com/jonschlinkert/micromatch) | All | all | Micromatch is built on top of the other libraries. | +| [micromatch](https://github.com/micromatch/micromatch) | All | all | Micromatch is built on top of the other libraries. | There are many resources available on the web if you want to dive deeper into how these features work in Bash. @@ -976,72 +1007,63 @@ npm i -d && node benchmark ### Latest results ```bash -Benchmarking: (6 of 6) - · globstar-basic - · large-list-globstar - · long-list-globstar - · negation-basic - · not-glob-basic - · star-basic - -# benchmark/fixtures/match/globstar-basic.js (182 bytes) - minimatch x 31,046 ops/sec ±0.56% (87 runs sampled) - multimatch x 27,787 ops/sec ±1.02% (88 runs sampled) - nanomatch x 453,686 ops/sec ±1.11% (89 runs sampled) +# globstar-basic (182 bytes) + minimatch x 70,508 ops/sec ±0.44% (92 runs sampled) + multimatch x 63,220 ops/sec ±0.76% (94 runs sampled) + nanomatch x 377,146 ops/sec ±0.45% (89 runs sampled) - fastest is nanomatch + fastest is nanomatch (by 564% avg) -# benchmark/fixtures/match/large-list-globstar.js (485686 bytes) - minimatch x 25.23 ops/sec ±0.46% (44 runs sampled) - multimatch x 25.20 ops/sec ±0.97% (43 runs sampled) - nanomatch x 735 ops/sec ±0.66% (89 runs sampled) +# large-list-globstar (485686 bytes) + minimatch x 35.67 ops/sec ±0.47% (61 runs sampled) + multimatch x 34.80 ops/sec ±1.77% (60 runs sampled) + nanomatch x 509 ops/sec ±0.43% (90 runs sampled) - fastest is nanomatch + fastest is nanomatch (by 1445% avg) -# benchmark/fixtures/match/long-list-globstar.js (194085 bytes) - minimatch x 258 ops/sec ±0.87% (83 runs sampled) - multimatch x 264 ops/sec ±0.90% (82 runs sampled) - nanomatch x 1,858 ops/sec ±0.56% (89 runs sampled) +# long-list-globstar (194085 bytes) + minimatch x 397 ops/sec ±0.96% (89 runs sampled) + multimatch x 400 ops/sec ±0.32% (90 runs sampled) + nanomatch x 843 ops/sec ±0.40% (92 runs sampled) - fastest is nanomatch + fastest is nanomatch (by 212% avg) -# benchmark/fixtures/match/negation-basic.js (132 bytes) - minimatch x 74,240 ops/sec ±1.22% (88 runs sampled) - multimatch x 25,360 ops/sec ±1.18% (89 runs sampled) - nanomatch x 545,835 ops/sec ±1.12% (88 runs sampled) +# negation-basic (132 bytes) + minimatch x 224,342 ops/sec ±1.07% (90 runs sampled) + multimatch x 68,071 ops/sec ±0.80% (89 runs sampled) + nanomatch x 442,204 ops/sec ±1.09% (91 runs sampled) - fastest is nanomatch + fastest is nanomatch (by 302% avg) -# benchmark/fixtures/match/not-glob-basic.js (93 bytes) - minimatch x 92,753 ops/sec ±1.59% (86 runs sampled) - multimatch x 50,125 ops/sec ±1.43% (87 runs sampled) - nanomatch x 1,195,648 ops/sec ±1.18% (87 runs sampled) +# not-glob-basic (93 bytes) + minimatch x 222,156 ops/sec ±0.98% (89 runs sampled) + multimatch x 179,724 ops/sec ±1.04% (91 runs sampled) + nanomatch x 1,446,098 ops/sec ±0.45% (92 runs sampled) - fastest is nanomatch + fastest is nanomatch (by 720% avg) -# benchmark/fixtures/match/star-basic.js (93 bytes) - minimatch x 70,746 ops/sec ±1.51% (86 runs sampled) - multimatch x 54,317 ops/sec ±1.45% (89 runs sampled) - nanomatch x 602,748 ops/sec ±1.17% (86 runs sampled) +# star-basic (93 bytes) + minimatch x 165,049 ops/sec ±1.22% (91 runs sampled) + multimatch x 132,553 ops/sec ±0.57% (90 runs sampled) + nanomatch x 522,080 ops/sec ±1.20% (92 runs sampled) - fastest is nanomatch + fastest is nanomatch (by 351% avg) ``` ## About -### Related projects - -* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob "Returns true if a string has an extglob.") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") - -### Contributing +<details> +<summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. -### Running tests +</details> + +<details> +<summary><strong>Running Tests</strong></summary> Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: @@ -1049,6 +1071,37 @@ Running and reviewing unit tests is a great way to get familiarized with a libra $ npm install && npm test ``` +</details> + +<details> +<summary><strong>Building docs</strong></summary> + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +</details> + +### Related projects + +You might also be interested in these projects: + +* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.") +* [is-extglob](https://www.npmjs.com/package/is-extglob): Returns true if a string has an extglob. | [homepage](https://github.com/jonschlinkert/is-extglob "Returns true if a string has an extglob.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 144 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [devongovett](https://github.com/devongovett) | + ### Author **Jon Schlinkert** @@ -1063,4 +1116,4 @@ Released under the [MIT License](LICENSE). *** -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 28, 2017._
\ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 20, 2017._
\ No newline at end of file diff --git a/node_modules/nanomatch/index.js b/node_modules/nanomatch/index.js index 3ffd08727..f402d59c9 100644 --- a/node_modules/nanomatch/index.js +++ b/node_modules/nanomatch/index.js @@ -169,7 +169,7 @@ nanomatch.isMatch = function(str, pattern, options) { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } - if (isEmptyString(str) || isEmptyString(pattern)) { + if (utils.isEmptyString(str) || utils.isEmptyString(pattern)) { return false; } @@ -279,7 +279,7 @@ nanomatch.any = function(str, patterns, options) { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } - if (isEmptyString(str) || isEmptyString(patterns)) { + if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { return false; } @@ -397,7 +397,7 @@ nanomatch.contains = function(str, patterns, options) { } if (typeof patterns === 'string') { - if (isEmptyString(str) || isEmptyString(patterns)) { + if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { return false; } @@ -477,10 +477,10 @@ nanomatch.matchKeys = function(obj, patterns, options) { */ nanomatch.matcher = function matcher(pattern, options) { - if (isEmptyString(pattern)) { + if (utils.isEmptyString(pattern)) { return function() { return false; - } + }; } if (Array.isArray(pattern)) { @@ -530,11 +530,54 @@ nanomatch.matcher = function matcher(pattern, options) { } var fn = test(re); - fn.result = re.result; + Object.defineProperty(fn, 'result', { + configurable: true, + enumerable: false, + value: re.result + }); return fn; }; /** + * Returns an array of matches captured by `pattern` in `string, or + * `null` if the pattern did not match. + * + * ```js + * var nm = require('nanomatch'); + * nm.capture(pattern, string[, options]); + * + * console.log(nm.capture('test/*.js', 'test/foo.js')); + * //=> ['foo'] + * console.log(nm.capture('test/*.js', 'foo/bar.css')); + * //=> null + * ``` + * @param {String} `pattern` Glob pattern to use for matching. + * @param {String} `string` String to match + * @param {Object} `options` See available [options](#options) for changing how matches are performed + * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. + * @api public + */ + +nanomatch.capture = function(pattern, str, options) { + var re = nanomatch.makeRe(pattern, extend({capture: true}, options)); + var unixify = utils.unixify(options); + + function match() { + return function(string) { + var match = re.exec(unixify(string)); + if (!match) { + return null; + } + + return match.slice(1); + }; + } + + var capture = memoize('capture', pattern, options, match); + return capture(str); +}; + +/** * Create a regular expression from the given glob `pattern`. * * ```js @@ -564,10 +607,14 @@ nanomatch.makeRe = function(pattern, options) { } function makeRe() { - var res = nanomatch.create(pattern, options); var opts = utils.extend({wrap: false}, options); + var res = nanomatch.create(pattern, opts); var regex = toRegex(res.output, opts); - regex.result = res; + Object.defineProperty(regex, 'result', { + configurable: true, + enumerable: false, + value: res + }); return regex; } @@ -728,14 +775,6 @@ nanomatch.clearCache = function() { }; /** - * Returns true if the given value is effectively an empty string - */ - -function isEmptyString(val) { - return String(val) === '' || String(val) === './'; -} - -/** * Compose a matcher function with the given patterns. * This allows matcher functions to be compiled once and * called multiple times. diff --git a/node_modules/nanomatch/lib/.DS_Store b/node_modules/nanomatch/lib/.DS_Store Binary files differnew file mode 100644 index 000000000..5008ddfcf --- /dev/null +++ b/node_modules/nanomatch/lib/.DS_Store diff --git a/node_modules/nanomatch/lib/compilers.js b/node_modules/nanomatch/lib/compilers.js index 1edcff0fd..c2331b287 100644 --- a/node_modules/nanomatch/lib/compilers.js +++ b/node_modules/nanomatch/lib/compilers.js @@ -1,7 +1,5 @@ 'use strict'; -var isExtglob = require('is-extglob'); - /** * Nanomatch compilers */ @@ -12,13 +10,11 @@ module.exports = function(nanomatch, options) { var ast = nanomatch.ast = nanomatch.parser.ast; ast.state = nanomatch.parser.state; nanomatch.compiler.state = ast.state; - nanomatch.compiler /** * Negation / escaping */ - .set('not', function(node) { var prev = this.prev(); if (this.options.nonegate === true || prev.type !== 'bos') { @@ -64,25 +60,33 @@ module.exports = function(nanomatch, options) { return this.emit(node.val, node); }) .set('slash', function(node, nodes, i) { + var val = '\\' + node.val; var parent = node.parent; + var prev = this.prev(); + + // set "node.hasSlash" to true on all ancestor parens nodes while (parent.type === 'paren' && !parent.hasSlash) { parent.hasSlash = true; parent = parent.parent; } + if (prev.addQmark) { + val += '?'; + } + // word boundary if (node.rest.slice(0, 2) === '\\b') { - return this.emit(node.val, node); + return this.emit(val, node); } - var parsed = node.parsed; - var val = '\\' + node.val; - - if (parsed === '**' || parsed === './**') { - this.output = '(^(?=.)|' + this.output; - return this.emit(val + ')', node); + // globstars + if (node.parsed === '**' || node.parsed === './**') { + this.output = '(?:' + this.output; + return this.emit(val + ')?', node); } - if (parsed === '!**' && this.options.nonegate !== true) { + + // negation + if (node.parsed === '!**' && this.options.nonegate !== true) { return this.emit(val + '?\\b', node); } return this.emit(val, node); @@ -176,12 +180,27 @@ module.exports = function(nanomatch, options) { */ .set('globstar', function(node, nodes, i) { - if (!this.output) this.output = '(?=.)' + this.output; + if (!this.output) { + this.state.leadingGlobstar = true; + } + var next = this.next(); var prev = this.prev(); + var next2 = this.next(2); + var prev2 = this.prev(2); var type = prev.type; var val = node.val; + if (prev.type === 'slash' && next.type === 'slash') { + if (prev2.type === 'text') { + this.output += '?'; + + if (next2.type !== 'text') { + this.output += '\\b'; + } + } + } + var parsed = node.parsed; if (parsed.charAt(0) === '!') { parsed = parsed.slice(1); @@ -195,18 +214,18 @@ module.exports = function(nanomatch, options) { : '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/))(?!\\.{2}).)*?'; } - var prior = nodes[i - 2] || {}; - if (type === 'slash' && this.output !== '\\/' && node.rest.charAt(0) === '/' && prior.type !== 'qmark' && !isExtglob(node.rest)) { - this.output += '?\\b'; - } - if ((type === 'slash' || type === 'bos') && this.options.dot !== true) { val = '(?!\\.)' + val; } - if (this.output === '\\/' && nodes[i + 1].type !== 'eos') { - this.output = '(\\/|'; - return this.emit('\\/' + val + ')?(?=.)', node); + if (prev.type === 'slash' && next.type === 'slash' && prev2.type !== 'text') { + if (next2.type === 'text' || next2.type === 'star') { + node.addQmark = true; + } + } + + if (this.options.capture) { + val = '(' + val + ')'; } return this.emit(val, node); @@ -255,7 +274,12 @@ module.exports = function(nanomatch, options) { this.output = '(?!\\.)' + this.output; } - return this.emit(prefix + star, node); + var output = prefix + star; + if (this.options.capture) { + output = '(' + output + ')'; + } + + return this.emit(output, node); }) /** @@ -271,14 +295,12 @@ module.exports = function(nanomatch, options) { */ .set('eos', function(node) { - if (this.output.slice(-2) === '/?' || this.output.slice(-6) === '(\\/|$)') { - return this.emit(node.val, node); - } - var prev = this.prev(); var val = node.val; + + this.output = '(?:(?:\\.(?:\\/|\\\\))(?=.))?' + this.output; if (this.state.metachar && prev.type !== 'qmark' && prev.type !== 'slash') { - val += (this.options.contains ? '\\/?' : '(\\/|$)'); + val += (this.options.contains ? '(?:\\/|\\\\)?' : '(?:(?:\\/|\\\\)|$)'); } return this.emit(val, node); diff --git a/node_modules/nanomatch/lib/parsers.js b/node_modules/nanomatch/lib/parsers.js index b98ef3746..0b0a59a59 100644 --- a/node_modules/nanomatch/lib/parsers.js +++ b/node_modules/nanomatch/lib/parsers.js @@ -39,13 +39,8 @@ module.exports = function(nanomatch, options) { var m = this.match(/^\.[\\/]/); if (!m) return; - this.ast.strictOpen = !!this.options.strictOpen; - this.ast.addPrefix = true; - - return pos({ - type: 'bos', - val: '' - }); + this.state.strictOpen = !!this.options.strictOpen; + this.state.addPrefix = true; }) /** @@ -130,11 +125,11 @@ module.exports = function(nanomatch, options) { if (!m) return; var val = m[0]; - this.ast.dot = val === '.' && (parsed === '' || parsed.slice(-1) === '/'); + this.state.dot = val === '.' && (parsed === '' || parsed.slice(-1) === '/'); return pos({ type: 'dot', - dotfiles: this.ast.dot, + dotfiles: this.state.dot, val: val }); }) @@ -175,7 +170,7 @@ module.exports = function(nanomatch, options) { var m = this.match(/^\*{2}(?![*(])(?=[,\/)]|$)/); if (!m) return; - var type = opts.noglobstar !== true ? 'globstar': 'star'; + var type = opts.noglobstar !== true ? 'globstar' : 'star'; var node = pos({type: type, parsed: parsed}); if (this.input.slice(0, 4) === '/**/') { diff --git a/node_modules/nanomatch/lib/utils.js b/node_modules/nanomatch/lib/utils.js index 962523be7..6fc434012 100644 --- a/node_modules/nanomatch/lib/utils.js +++ b/node_modules/nanomatch/lib/utils.js @@ -16,6 +16,14 @@ utils.typeOf = require('kind-of'); utils.unique = require('array-unique'); /** + * Returns true if the given value is effectively an empty string + */ + +utils.isEmptyString = function(val) { + return String(val) === '' || String(val) === './'; +}; + +/** * Returns true if the platform is windows, or `path.sep` is `\\`. * This is defined as a function to allow `path.sep` to be set in unit tests, * or by the user, if there is a reason to do so. @@ -204,11 +212,7 @@ utils.stripDrive = function(fp) { */ utils.stripPrefix = function(str) { - if (str.charAt(0) !== '.') { - return str; - } - var ch = str.charAt(1); - if (utils.isSlash(ch)) { + if (str.charAt(0) === '.' && (str.charAt(1) === '/' || str.charAt(1) === '\\')) { return str.slice(2); } return str; @@ -342,6 +346,9 @@ utils.value = function(str, unixify, options) { if (options && options.unixify === false) { return str; } + if (options && typeof options.unixify === 'function') { + return options.unixify(str); + } return unixify(str); }; @@ -353,17 +360,17 @@ utils.value = function(str, unixify, options) { */ utils.unixify = function(options) { - options = options || {}; + var opts = options || {}; return function(filepath) { - if (utils.isWindows() || options.unixify === true) { - filepath = utils.toPosixPath(filepath); - } - if (options.stripPrefix !== false) { + if (opts.stripPrefix !== false) { filepath = utils.stripPrefix(filepath); } - if (options.unescape === true) { + if (opts.unescape === true) { filepath = utils.unescape(filepath); } + if (opts.unixify === true || utils.isWindows()) { + filepath = utils.toPosixPath(filepath); + } return filepath; }; }; diff --git a/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/LICENSE b/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/LICENSE deleted file mode 100644 index 943e71d05..000000000 --- a/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2017, Jon Schlinkert. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.
\ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/README.md b/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/README.md deleted file mode 100644 index 065d2f8a2..000000000 --- a/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/README.md +++ /dev/null @@ -1,329 +0,0 @@ -# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) - -> Get the native type of a value. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save kind-of -``` - -Install with [bower](https://bower.io/) - -```sh -$ bower install kind-of --save -``` - -## Why use this? - -1. [it's fast](#benchmarks) | [optimizations](#optimizations) -2. [better type checking](#better-type-checking) - -## Usage - -> es5, browser and es6 ready - -```js -var kindOf = require('kind-of'); - -kindOf(undefined); -//=> 'undefined' - -kindOf(null); -//=> 'null' - -kindOf(true); -//=> 'boolean' - -kindOf(false); -//=> 'boolean' - -kindOf(new Boolean(true)); -//=> 'boolean' - -kindOf(new Buffer('')); -//=> 'buffer' - -kindOf(42); -//=> 'number' - -kindOf(new Number(42)); -//=> 'number' - -kindOf('str'); -//=> 'string' - -kindOf(new String('str')); -//=> 'string' - -kindOf(arguments); -//=> 'arguments' - -kindOf({}); -//=> 'object' - -kindOf(Object.create(null)); -//=> 'object' - -kindOf(new Test()); -//=> 'object' - -kindOf(new Date()); -//=> 'date' - -kindOf([]); -//=> 'array' - -kindOf([1, 2, 3]); -//=> 'array' - -kindOf(new Array()); -//=> 'array' - -kindOf(/foo/); -//=> 'regexp' - -kindOf(new RegExp('foo')); -//=> 'regexp' - -kindOf(function () {}); -//=> 'function' - -kindOf(function * () {}); -//=> 'function' - -kindOf(new Function()); -//=> 'function' - -kindOf(new Map()); -//=> 'map' - -kindOf(new WeakMap()); -//=> 'weakmap' - -kindOf(new Set()); -//=> 'set' - -kindOf(new WeakSet()); -//=> 'weakset' - -kindOf(Symbol('str')); -//=> 'symbol' - -kindOf(new Int8Array()); -//=> 'int8array' - -kindOf(new Uint8Array()); -//=> 'uint8array' - -kindOf(new Uint8ClampedArray()); -//=> 'uint8clampedarray' - -kindOf(new Int16Array()); -//=> 'int16array' - -kindOf(new Uint16Array()); -//=> 'uint16array' - -kindOf(new Int32Array()); -//=> 'int32array' - -kindOf(new Uint32Array()); -//=> 'uint32array' - -kindOf(new Float32Array()); -//=> 'float32array' - -kindOf(new Float64Array()); -//=> 'float64array' -``` - -## Release history - -### v4.0.0 - -**Added** - -* `promise` support - -### v5.0.0 - -**Added** - -* `Set Iterator` and `Map Iterator` support - -**Fixed** - -* Now returns `generatorfunction` for generator functions - -## Benchmarks - -Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). -Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`. - -```bash -#1: array - current x 23,329,397 ops/sec ±0.82% (94 runs sampled) - lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled) - lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled) - -#2: boolean - current x 27,197,115 ops/sec ±0.85% (94 runs sampled) - lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled) - lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled) - -#3: date - current x 20,190,117 ops/sec ±0.86% (92 runs sampled) - lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled) - lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled) - -#4: function - current x 23,855,460 ops/sec ±0.60% (97 runs sampled) - lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled) - lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled) - -#5: null - current x 27,061,047 ops/sec ±0.97% (96 runs sampled) - lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled) - lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled) - -#6: number - current x 25,075,682 ops/sec ±0.53% (99 runs sampled) - lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled) - lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled) - -#7: object - current x 3,348,980 ops/sec ±0.49% (99 runs sampled) - lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled) - lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled) - -#8: regex - current x 21,284,827 ops/sec ±0.72% (96 runs sampled) - lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled) - lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled) - -#9: string - current x 25,379,234 ops/sec ±0.58% (96 runs sampled) - lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled) - lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled) - -#10: undef - current x 27,459,221 ops/sec ±1.01% (93 runs sampled) - lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled) - lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled) - -``` - -## Optimizations - -In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: - -1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. -2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. -3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` -4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. - -## Better type checking - -kind-of is more correct than other type checking libs I've looked at. For example, here are some differing results from other popular libs: - -### [typeof](https://github.com/CodingFu/typeof) lib - -Incorrectly tests instances of custom constructors (pretty common): - -```js -var typeOf = require('typeof'); -function Test() {} -console.log(typeOf(new Test())); -//=> 'test' -``` - -Returns `object` instead of `arguments`: - -```js -function foo() { - console.log(typeOf(arguments)) //=> 'object' -} -foo(); -``` - -### [type-of](https://github.com/ForbesLindesay/type-of) lib - -Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: - -```js -function * foo() {} -console.log(typeOf(foo)); -//=> 'object' -console.log(typeOf(new Buffer(''))); -//=> 'object' -console.log(typeOf(new Map())); -//=> 'object' -console.log(typeOf(new Set())); -//=> 'object' -console.log(typeOf(new WeakMap())); -//=> 'object' -console.log(typeOf(new WeakSet())); -//=> 'object' -``` - -## About - -### Related projects - -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 78 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [aretecode](https://github.com/aretecode) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | -| 1 | [charlike](https://github.com/charlike) | - -### Building docs - -_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ - -To generate the readme, run the following command: - -```sh -$ npm install -g verbose/verb#dev verb-generate-readme && verb -``` - -### Running tests - -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: - -```sh -$ npm install && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT License](LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on August 02, 2017._
\ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/index.js b/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/index.js deleted file mode 100644 index ce2c8b933..000000000 --- a/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/index.js +++ /dev/null @@ -1,140 +0,0 @@ -var toString = Object.prototype.toString; - -/** - * Get the native `typeof` a value. - * - * @param {*} `val` - * @return {*} Native javascript type - */ - -module.exports = function kindOf(val) { - var type = typeof val; - - // primitivies - if (type === 'undefined') { - return 'undefined'; - } - if (val === null) { - return 'null'; - } - if (val === true || val === false || val instanceof Boolean) { - return 'boolean'; - } - if (type === 'string' || val instanceof String) { - return 'string'; - } - if (type === 'number' || val instanceof Number) { - return 'number'; - } - - // functions - if (type === 'function' || val instanceof Function) { - if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') { - return 'generatorfunction'; - } - return 'function'; - } - - // array - if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { - return 'array'; - } - - // check for instances of RegExp and Date before calling `toString` - if (val instanceof RegExp) { - return 'regexp'; - } - if (val instanceof Date) { - return 'date'; - } - - // other objects - type = toString.call(val); - - if (type === '[object RegExp]') { - return 'regexp'; - } - if (type === '[object Date]') { - return 'date'; - } - if (type === '[object Arguments]') { - return 'arguments'; - } - if (type === '[object Error]') { - return 'error'; - } - if (type === '[object Promise]') { - return 'promise'; - } - - // buffer - if (isBuffer(val)) { - return 'buffer'; - } - - // es6: Map, WeakMap, Set, WeakSet - if (type === '[object Set]') { - return 'set'; - } - if (type === '[object WeakSet]') { - return 'weakset'; - } - if (type === '[object Map]') { - return 'map'; - } - if (type === '[object WeakMap]') { - return 'weakmap'; - } - if (type === '[object Symbol]') { - return 'symbol'; - } - if (type === '[object Map Iterator]') { - return 'mapiterator'; - } - if (type === '[object Set Iterator]') { - return 'setiterator'; - } - - // typed arrays - if (type === '[object Int8Array]') { - return 'int8array'; - } - if (type === '[object Uint8Array]') { - return 'uint8array'; - } - if (type === '[object Uint8ClampedArray]') { - return 'uint8clampedarray'; - } - if (type === '[object Int16Array]') { - return 'int16array'; - } - if (type === '[object Uint16Array]') { - return 'uint16array'; - } - if (type === '[object Int32Array]') { - return 'int32array'; - } - if (type === '[object Uint32Array]') { - return 'uint32array'; - } - if (type === '[object Float32Array]') { - return 'float32array'; - } - if (type === '[object Float64Array]') { - return 'float64array'; - } - - // must be a plain object - return 'object'; -}; - -/** - * If you need to support Safari 5-7 (8-10 yr-old browser), - * take a look at https://github.com/feross/is-buffer - */ - -function isBuffer(val) { - return val.constructor - && typeof val.constructor.isBuffer === 'function' - && val.constructor.isBuffer(val); -} diff --git a/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/package.json b/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/package.json deleted file mode 100644 index d60087ff8..000000000 --- a/node_modules/nanomatch/node_modules/is-descriptor/node_modules/kind-of/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "kind-of", - "description": "Get the native type of a value.", - "version": "5.0.2", - "homepage": "https://github.com/jonschlinkert/kind-of", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Charlike Mike Reagent (https://i.am.charlike.online)", - "David Fox-Powell (https://dtothefp.github.io/me)", - "James (https://twitter.com/aretecode)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Ken Sheedlo (kensheedlo.com)", - "laggingreflex (https://github.com/laggingreflex)", - "Miguel Mota (https://miguelmota.com)", - "Peter deHaan (http://about.me/peterdehaan)" - ], - "repository": "jonschlinkert/kind-of", - "bugs": { - "url": "https://github.com/jonschlinkert/kind-of/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha", - "prepublish": "browserify -o browser.js -e index.js -s index --bare" - }, - "devDependencies": { - "ansi-bold": "^0.1.1", - "benchmarked": "^1.1.1", - "browserify": "^14.4.0", - "gulp-format-md": "^0.1.12", - "matched": "^0.4.4", - "mocha": "^3.4.2", - "type-of": "^2.0.1", - "typeof": "^1.0.0" - }, - "keywords": [ - "arguments", - "array", - "boolean", - "check", - "date", - "function", - "is", - "is-type", - "is-type-of", - "kind", - "kind-of", - "number", - "object", - "of", - "regexp", - "string", - "test", - "type", - "type-of", - "typeof", - "types" - ], - "verb": { - "related": { - "list": [ - "is-glob", - "is-number", - "is-primitive" - ] - }, - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - }, - "reflinks": [ - "type-of", - "typeof", - "verb" - ] - } -} diff --git a/node_modules/nanomatch/node_modules/is-extglob/LICENSE b/node_modules/nanomatch/node_modules/is-extglob/LICENSE deleted file mode 100644 index 842218cf0..000000000 --- a/node_modules/nanomatch/node_modules/is-extglob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, Jon Schlinkert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/nanomatch/node_modules/is-extglob/README.md b/node_modules/nanomatch/node_modules/is-extglob/README.md deleted file mode 100644 index 0416af5c3..000000000 --- a/node_modules/nanomatch/node_modules/is-extglob/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) - -> Returns true if a string has an extglob. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-extglob -``` - -## Usage - -```js -var isExtglob = require('is-extglob'); -``` - -**True** - -```js -isExtglob('?(abc)'); -isExtglob('@(abc)'); -isExtglob('!(abc)'); -isExtglob('*(abc)'); -isExtglob('+(abc)'); -``` - -**False** - -Escaped extglobs: - -```js -isExtglob('\\?(abc)'); -isExtglob('\\@(abc)'); -isExtglob('\\!(abc)'); -isExtglob('\\*(abc)'); -isExtglob('\\+(abc)'); -``` - -Everything else... - -```js -isExtglob('foo.js'); -isExtglob('!foo.js'); -isExtglob('*.js'); -isExtglob('**/abc.js'); -isExtglob('abc/*.js'); -isExtglob('abc/(aaa|bbb).js'); -isExtglob('abc/[a-z].js'); -isExtglob('abc/{a,b}.js'); -isExtglob('abc/?.js'); -isExtglob('abc.js'); -isExtglob('abc/def/ghi.js'); -``` - -## History - -**v2.0** - -Adds support for escaping. Escaped exglobs no longer return true. - -## About - -### Related projects - -* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._
\ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/is-extglob/index.js b/node_modules/nanomatch/node_modules/is-extglob/index.js deleted file mode 100644 index c1d986fc5..000000000 --- a/node_modules/nanomatch/node_modules/is-extglob/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/*! - * is-extglob <https://github.com/jonschlinkert/is-extglob> - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ - -module.exports = function isExtglob(str) { - if (typeof str !== 'string' || str === '') { - return false; - } - - var match; - while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { - if (match[2]) return true; - str = str.slice(match.index + match[0].length); - } - - return false; -}; diff --git a/node_modules/nanomatch/node_modules/is-extglob/package.json b/node_modules/nanomatch/node_modules/is-extglob/package.json deleted file mode 100644 index 7a908369d..000000000 --- a/node_modules/nanomatch/node_modules/is-extglob/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "is-extglob", - "description": "Returns true if a string has an extglob.", - "version": "2.1.1", - "homepage": "https://github.com/jonschlinkert/is-extglob", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "repository": "jonschlinkert/is-extglob", - "bugs": { - "url": "https://github.com/jonschlinkert/is-extglob/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "keywords": [ - "bash", - "braces", - "check", - "exec", - "expression", - "extglob", - "glob", - "globbing", - "globstar", - "is", - "match", - "matches", - "pattern", - "regex", - "regular", - "string", - "test" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "has-glob", - "is-glob", - "micromatch" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ], - "lint": { - "reflinks": true - } - } -} diff --git a/node_modules/nanomatch/node_modules/kind-of/LICENSE b/node_modules/nanomatch/node_modules/kind-of/LICENSE index d734237bd..3f2eca18f 100644 --- a/node_modules/nanomatch/node_modules/kind-of/LICENSE +++ b/node_modules/nanomatch/node_modules/kind-of/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2017, Jon Schlinkert +Copyright (c) 2014-2017, Jon Schlinkert. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/nanomatch/node_modules/kind-of/README.md b/node_modules/nanomatch/node_modules/kind-of/README.md index 83469b0b6..170bf3049 100644 --- a/node_modules/nanomatch/node_modules/kind-of/README.md +++ b/node_modules/nanomatch/node_modules/kind-of/README.md @@ -2,6 +2,8 @@ > Get the native type of a value. +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + ## Install Install with [npm](https://www.npmjs.com/): @@ -16,6 +18,11 @@ Install with [bower](https://bower.io/) $ bower install kind-of --save ``` +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + ## Usage > es5, browser and es6 ready @@ -135,6 +142,24 @@ kindOf(new Float64Array()); //=> 'float64array' ``` +## Release history + +### v4.0.0 + +**Added** + +* `promise` support + +### v5.0.0 + +**Added** + +* `Set Iterator` and `Map Iterator` support + +**Fixed** + +* Now returns `generatorfunction` for generator functions + ## Benchmarks Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). @@ -193,14 +218,6 @@ Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `We ``` -## Release history - -### v4.0.0 - -**Added** - -* `promise` support - ## Optimizations In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: @@ -208,31 +225,74 @@ In 7 out of 8 cases, this library is 2x-10x faster than other top libraries incl 1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. 2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. 3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. -## About +## Better type checking -### Related projects +kind-of is more correct than other type checking libs I've looked at. For example, here are some differing results from other popular libs: -* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") -* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") -* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly tests instances of custom constructors (pretty common): -### Contributing +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +<details> +<summary><strong>Contributing</strong></summary> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). -### Contributors +<details> -| **Commits** | **Contributor** | -| --- | --- | -| 64 | [jonschlinkert](https://github.com/jonschlinkert) | -| 2 | [miguelmota](https://github.com/miguelmota) | -| 1 | [dtothefp](https://github.com/dtothefp) | -| 1 | [ksheedlo](https://github.com/ksheedlo) | -| 1 | [pdehaan](https://github.com/pdehaan) | -| 1 | [laggingreflex](https://github.com/laggingreflex) | +<details> +<summary><strong>Running Tests</strong></summary> + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +<details> -### Building docs +<details> +<summary><strong>Building docs</strong></summary> _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ @@ -242,13 +302,28 @@ To generate the readme, run the following command: $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` -### Running tests +<details> -Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: +### Related projects -```sh -$ npm install && npm test -``` +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 82 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [charlike](https://github.com/charlike) | ### Author @@ -264,4 +339,4 @@ Released under the [MIT License](LICENSE). *** -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 19, 2017._
\ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 13, 2017._
\ No newline at end of file diff --git a/node_modules/nanomatch/node_modules/kind-of/index.js b/node_modules/nanomatch/node_modules/kind-of/index.js index 4c0233bc7..fc5cde96e 100644 --- a/node_modules/nanomatch/node_modules/kind-of/index.js +++ b/node_modules/nanomatch/node_modules/kind-of/index.js @@ -1,4 +1,3 @@ -var isBuffer = require('is-buffer'); var toString = Object.prototype.toString; /** @@ -9,8 +8,10 @@ var toString = Object.prototype.toString; */ module.exports = function kindOf(val) { + var type = typeof val; + // primitivies - if (typeof val === 'undefined') { + if (type === 'undefined') { return 'undefined'; } if (val === null) { @@ -19,15 +20,18 @@ module.exports = function kindOf(val) { if (val === true || val === false || val instanceof Boolean) { return 'boolean'; } - if (typeof val === 'string' || val instanceof String) { + if (type === 'string' || val instanceof String) { return 'string'; } - if (typeof val === 'number' || val instanceof Number) { + if (type === 'number' || val instanceof Number) { return 'number'; } // functions - if (typeof val === 'function' || val instanceof Function) { + if (type === 'function' || val instanceof Function) { + if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') { + return 'generatorfunction'; + } return 'function'; } @@ -45,7 +49,7 @@ module.exports = function kindOf(val) { } // other objects - var type = toString.call(val); + type = toString.call(val); if (type === '[object RegExp]') { return 'regexp'; @@ -84,7 +88,20 @@ module.exports = function kindOf(val) { if (type === '[object Symbol]') { return 'symbol'; } - + + if (type === '[object Map Iterator]') { + return 'mapiterator'; + } + if (type === '[object Set Iterator]') { + return 'setiterator'; + } + if (type === '[object String Iterator]') { + return 'stringiterator'; + } + if (type === '[object Array Iterator]') { + return 'arrayiterator'; + } + // typed arrays if (type === '[object Int8Array]') { return 'int8array'; @@ -117,3 +134,14 @@ module.exports = function kindOf(val) { // must be a plain object return 'object'; }; + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + return val.constructor + && typeof val.constructor.isBuffer === 'function' + && val.constructor.isBuffer(val); +} diff --git a/node_modules/nanomatch/node_modules/kind-of/package.json b/node_modules/nanomatch/node_modules/kind-of/package.json index 222afc0b2..334235fb0 100644 --- a/node_modules/nanomatch/node_modules/kind-of/package.json +++ b/node_modules/nanomatch/node_modules/kind-of/package.json @@ -1,16 +1,18 @@ { "name": "kind-of", "description": "Get the native type of a value.", - "version": "4.0.0", + "version": "5.1.0", "homepage": "https://github.com/jonschlinkert/kind-of", "author": "Jon Schlinkert (https://github.com/jonschlinkert)", "contributors": [ "David Fox-Powell (https://dtothefp.github.io/me)", + "James (https://twitter.com/aretecode)", "Jon Schlinkert (http://twitter.com/jonschlinkert)", "Ken Sheedlo (kensheedlo.com)", "laggingreflex (https://github.com/laggingreflex)", "Miguel Mota (https://miguelmota.com)", - "Peter deHaan (http://about.me/peterdehaan)" + "Peter deHaan (http://about.me/peterdehaan)", + "tunnckoCore (https://i.am.charlike.online)" ], "repository": "jonschlinkert/kind-of", "bugs": { @@ -28,16 +30,13 @@ "test": "mocha", "prepublish": "browserify -o browser.js -e index.js -s index --bare" }, - "dependencies": { - "is-buffer": "^1.1.5" - }, "devDependencies": { "ansi-bold": "^0.1.1", "benchmarked": "^1.1.1", - "browserify": "^14.3.0", - "glob": "^7.1.1", + "browserify": "^14.4.0", "gulp-format-md": "^0.1.12", - "mocha": "^3.4.1", + "matched": "^0.4.4", + "mocha": "^3.4.2", "type-of": "^2.0.1", "typeof": "^1.0.0" }, @@ -84,6 +83,8 @@ "reflinks": true }, "reflinks": [ + "type-of", + "typeof", "verb" ] } diff --git a/node_modules/nanomatch/package.json b/node_modules/nanomatch/package.json index 443148421..523fa0d30 100644 --- a/node_modules/nanomatch/package.json +++ b/node_modules/nanomatch/package.json @@ -1,9 +1,13 @@ { "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.2.0", + "version": "1.2.6", "homepage": "https://github.com/micromatch/nanomatch", "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Devon Govett (http://badassjs.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], "repository": "micromatch/nanomatch", "bugs": { "url": "https://github.com/micromatch/nanomatch/issues" @@ -26,32 +30,27 @@ "define-property": "^1.0.0", "extend-shallow": "^2.0.1", "fragment-cache": "^0.2.1", - "is-extglob": "^2.1.1", "is-odd": "^1.0.0", - "kind-of": "^4.0.0", - "object.pick": "^1.2.0", + "kind-of": "^5.0.2", + "object.pick": "^1.3.0", "regex-not": "^1.0.0", "snapdragon": "^0.8.1", "to-regex": "^3.0.1" }, "devDependencies": { - "ansi-cyan": "^0.1.1", - "bash-match": "^0.2.0", - "benchmarked": "^0.2.5", + "bash-match": "^1.0.2", "for-own": "^1.0.0", "gulp": "^3.9.1", - "gulp-format-md": "^0.1.11", - "gulp-istanbul": "^1.1.1", + "gulp-format-md": "^1.0.0", + "gulp-istanbul": "^1.1.2", "gulp-mocha": "^3.0.1", "gulp-unused": "^0.2.1", "helper-changelog": "^0.3.0", - "is-primitive": "^2.0.0", - "is-windows": "^1.0.0", - "isobject": "^3.0.0", - "minimatch": "^3.0.3", - "mocha": "^3.2.0", - "multimatch": "^2.1.0", - "yargs-parser": "^5.0.0" + "is-windows": "^1.0.1", + "minimatch": "^3.0.4", + "minimist": "^1.2.0", + "mocha": "^3.5.0", + "multimatch": "^2.1.0" }, "keywords": [ "bash", @@ -84,16 +83,26 @@ "wildcard" ], "lintDeps": { - "files": { - "merge": true, - "devDependencies": [ - "benchmark/**/*.js" - ] + "dependencies": { + "options": { + "lock": { + "snapdragon": "^0.8.1" + } + } + }, + "devDependencies": { + "files": { + "options": { + "ignore": [ + "benchmark/**" + ] + } + } } }, "verb": { "toc": "collapsible", - "layout": "common-minimal", + "layout": "default", "tasks": [ "readme" ], @@ -105,21 +114,15 @@ ], "related": { "list": [ + "extglob", "is-extglob", - "is-glob" + "is-glob", + "micromatch" ] }, "reflinks": [ - "a-c", - "bash-braces", - "bash-brackets", - "bash-extglobs", - "bash-globs", - "bash-tilde", - "braces", "expand-brackets", "expand-tilde", - "extglob", "glob-object", "micromatch", "minimatch", |