diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-10 03:43:44 +0200 |
commit | abd94a7f5a50f43c797a11b53549ae48fff667c3 (patch) | |
tree | ab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/to-absolute-glob | |
parent | a0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff) |
add node_modules to address #4364
Diffstat (limited to 'node_modules/to-absolute-glob')
-rw-r--r-- | node_modules/to-absolute-glob/LICENSE | 21 | ||||
-rw-r--r-- | node_modules/to-absolute-glob/index.js | 28 | ||||
-rw-r--r-- | node_modules/to-absolute-glob/package.json | 105 | ||||
-rw-r--r-- | node_modules/to-absolute-glob/readme.md | 134 |
4 files changed, 288 insertions, 0 deletions
diff --git a/node_modules/to-absolute-glob/LICENSE b/node_modules/to-absolute-glob/LICENSE new file mode 100644 index 000000000..65f90aca8 --- /dev/null +++ b/node_modules/to-absolute-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, 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/to-absolute-glob/index.js b/node_modules/to-absolute-glob/index.js new file mode 100644 index 000000000..08268a1f1 --- /dev/null +++ b/node_modules/to-absolute-glob/index.js @@ -0,0 +1,28 @@ +'use strict'; + +var path = require('path'); +var extend = require('extend-shallow'); + +module.exports = function(glob, options) { + var opts = extend({}, options); + opts.cwd = opts.cwd ? path.resolve(opts.cwd) : process.cwd(); + + // store first and last characters before glob is modified + var prefix = glob.charAt(0); + var suffix = glob.slice(-1); + + var isNegative = prefix === '!'; + if (isNegative) glob = glob.slice(1); + + if (opts.root && glob.charAt(0) === '/') { + glob = path.join(path.resolve(opts.root), '.' + glob); + } else { + glob = path.resolve(opts.cwd, glob); + } + + if (suffix === '/' && glob.slice(-1) !== '/') { + glob += '/'; + } + + return isNegative ? '!' + glob : glob; +}; diff --git a/node_modules/to-absolute-glob/package.json b/node_modules/to-absolute-glob/package.json new file mode 100644 index 000000000..51d6f259c --- /dev/null +++ b/node_modules/to-absolute-glob/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "to-absolute-glob@^0.1.1", + "scope": null, + "escapedName": "to-absolute-glob", + "name": "to-absolute-glob", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/vinyl-fs/node_modules/glob-stream" + ] + ], + "_from": "to-absolute-glob@>=0.1.1 <0.2.0", + "_id": "to-absolute-glob@0.1.1", + "_inCache": true, + "_location": "/to-absolute-glob", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.3.6", + "_phantomChildren": {}, + "_requested": { + "raw": "to-absolute-glob@^0.1.1", + "scope": null, + "escapedName": "to-absolute-glob", + "name": "to-absolute-glob", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/vinyl-fs/glob-stream" + ], + "_resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", + "_shasum": "1cdfa472a9ef50c239ee66999b662ca0eb39937f", + "_shrinkwrap": null, + "_spec": "to-absolute-glob@^0.1.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/vinyl-fs/node_modules/glob-stream", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/to-absolute-glob/issues" + }, + "dependencies": { + "extend-shallow": "^2.0.1" + }, + "description": "Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "1cdfa472a9ef50c239ee66999b662ca0eb39937f", + "tarball": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "42428d988edb8c0cd7d97fbc0622b9720dc57437", + "homepage": "https://github.com/jonschlinkert/to-absolute-glob", + "keywords": [ + "resolve", + "pattern", + "absolute", + "glob" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "to-absolute-glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/to-absolute-glob.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "related": { + "list": [ + "is-glob", + "is-valid-glob", + "has-glob" + ] + } + }, + "version": "0.1.1" +} diff --git a/node_modules/to-absolute-glob/readme.md b/node_modules/to-absolute-glob/readme.md new file mode 100644 index 000000000..1834c23f5 --- /dev/null +++ b/node_modules/to-absolute-glob/readme.md @@ -0,0 +1,134 @@ +# to-absolute-glob [![NPM version](https://badge.fury.io/js/to-absolute-glob.svg)](http://badge.fury.io/js/to-absolute-glob) + +> Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled. + +## Install + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i to-absolute-glob --save +``` + +## Usage + +```js +var toAbsGlob = require('to-absolute-glob'); +toAbsGlob('a/*.js'); +//=> '/dev/foo/a/*.js' +``` + +## Examples + +Given the current project folder (cwd) is `/dev/foo/`: + +**makes a path absolute** + +```js +toAbsGlob('a'); +//=> '/dev/foo/a' +``` + +**makes a glob absolute** + +```js +toAbsGlob('a/*.js'); +//=> '/dev/foo/a/*.js' +``` + +**retains trailing slashes** + +```js +toAbsGlob('a/*/'); +//=> '/dev/foo/a/*/' +``` + +**retains trailing slashes with cwd** + +```js +toAbsGlob('./fixtures/whatsgoingon/*/', {cwd: __dirname}); +//=> '/dev/foo/' +``` + +**makes a negative glob absolute** + +```js +toAbsGlob('!a/*.js'); +//=> '!/dev/foo/a/*.js' +``` + +**from a cwd** + +```js +toAbsGlob('a/*.js', {cwd: 'foo'}); +//=> '/dev/foo/foo/a/*.js' +``` + +**makes a negative glob absolute from a cwd** + +```js +toAbsGlob('!a/*.js', {cwd: 'foo'}); +//=> '!/dev/foo/foo/a/*.js' +``` + +**from a root path** + +```js +toAbsGlob('/a/*.js', {root: 'baz'}); +//=> '/dev/foo/baz/a/*.js' +``` + +**from a root slash** + +```js +toAbsGlob('/a/*.js', {root: '/'}); +//=> '/dev/foo/a/*.js' +``` + +**from a negative root path** + +```js +toAbsGlob('!/a/*.js', {root: 'baz'}); +//=> '!/dev/foo/baz/a/*.js' +``` + +**from a negative root slash** + +```js +toAbsGlob('!/a/*.js', {root: '/'}); +//=> '!/dev/foo/a/*.js' +``` + +## 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) +* [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://www.npmjs.com/package/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob) +* [is-valid-glob](https://www.npmjs.com/package/is-valid-glob): Return true if a value is a valid glob pattern or patterns. | [homepage](https://github.com/jonschlinkert/is-valid-glob) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](/new). + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 05, 2015._
\ No newline at end of file |