WIP - add extractor, generate snippet_data
This commit is contained in:
21
node_modules/contains-path/LICENSE
generated
vendored
Normal file
21
node_modules/contains-path/LICENSE
generated
vendored
Normal file
@ -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.
|
||||
83
node_modules/contains-path/README.md
generated
vendored
Normal file
83
node_modules/contains-path/README.md
generated
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
# contains-path [](http://badge.fury.io/js/contains-path)
|
||||
|
||||
> Return true if a file path contains the given path.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i contains-path --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var contains = require('contains-path');
|
||||
```
|
||||
|
||||
**true**
|
||||
|
||||
All of the following return `true`:
|
||||
|
||||
```js
|
||||
containsPath('./a/b/c', 'a');
|
||||
containsPath('./a/b/c', 'a/b');
|
||||
containsPath('./b/a/b/c', 'a/b');
|
||||
containsPath('/a/b/c', '/a/b');
|
||||
containsPath('/a/b/c', 'a/b');
|
||||
containsPath('a', 'a');
|
||||
containsPath('a/b/c', 'a');
|
||||
//=> true
|
||||
```
|
||||
|
||||
**false**
|
||||
|
||||
All of the following return `false`:
|
||||
|
||||
```js
|
||||
containsPath('abc', 'a');
|
||||
containsPath('abc', 'a.md');
|
||||
containsPath('./b/a/b/c', './a/b');
|
||||
containsPath('./b/a/b/c', './a');
|
||||
containsPath('./b/a/b/c', '/a/b');
|
||||
containsPath('/b/a/b/c', '/a/b');
|
||||
//=> false
|
||||
```
|
||||
|
||||
## Related projects
|
||||
|
||||
* [ends-with](https://github.com/jonschlinkert/ends-with): Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for… [more](https://github.com/jonschlinkert/ends-with)
|
||||
* [is-absolute](https://github.com/jonschlinkert/is-absolute): Return true if a file path is absolute.
|
||||
* [is-relative](https://github.com/jonschlinkert/is-relative): Returns `true` if the path appears to be relative.
|
||||
* [path-ends-with](https://github.com/jonschlinkert/path-ends-with): Return `true` if a file path ends with the given string/suffix.
|
||||
* [path-segments](https://github.com/jonschlinkert/path-segments): Get n specific segments of a file path, e.g. first 2, last 3, etc.
|
||||
* [parse-filepath](https://github.com/jonschlinkert/parse-filepath): Parse a filepath into an object, yielding predictable results for basename and extname.
|
||||
|
||||
## 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](https://github.com/jonschlinkert/contains-path/issues/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 July 07, 2015._
|
||||
33
node_modules/contains-path/index.js
generated
vendored
Normal file
33
node_modules/contains-path/index.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
|
||||
function containsPath(fp, segment) {
|
||||
if (typeof fp !== 'string' || typeof segment !== 'string') {
|
||||
throw new TypeError('contains-path expects file paths to be a string.');
|
||||
}
|
||||
|
||||
var prefix = '(^|\\/)';
|
||||
if (segment.indexOf('./') === 0 || segment.charAt(0) === '/') {
|
||||
prefix = '^';
|
||||
}
|
||||
|
||||
var re = new RegExp(prefix + normalize(segment).join('\\/') + '($|\\/)');
|
||||
fp = normalize(fp).join('/');
|
||||
return re.test(fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize slashes
|
||||
*/
|
||||
|
||||
function normalize(str) {
|
||||
str = path.normalize(str);
|
||||
return str.split(/[\\\/]+/);
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose `containsPath`
|
||||
*/
|
||||
|
||||
module.exports = containsPath;
|
||||
86
node_modules/contains-path/package.json
generated
vendored
Normal file
86
node_modules/contains-path/package.json
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"_from": "contains-path@^0.1.0",
|
||||
"_id": "contains-path@0.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
|
||||
"_location": "/contains-path",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "contains-path@^0.1.0",
|
||||
"name": "contains-path",
|
||||
"escapedName": "contains-path",
|
||||
"rawSpec": "^0.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^0.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/eslint-plugin-import"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
|
||||
"_shasum": "fe8cf184ff6670b6baef01a9d4861a5cbec4120a",
|
||||
"_spec": "contains-path@^0.1.0",
|
||||
"_where": "/Users/stefanfejes/Projects/30-seconds-of-python-code/node_modules/eslint-plugin-import",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/contains-path/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "Return true if a file path contains the given path.",
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/jonschlinkert/contains-path",
|
||||
"keywords": [
|
||||
"contains",
|
||||
"directory",
|
||||
"dirname",
|
||||
"exec",
|
||||
"ext",
|
||||
"extname",
|
||||
"file",
|
||||
"filepath",
|
||||
"fp",
|
||||
"has",
|
||||
"match",
|
||||
"matches",
|
||||
"path",
|
||||
"regex",
|
||||
"test"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "contains-path",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jonschlinkert/contains-path.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"verb": {
|
||||
"related": {
|
||||
"list": [
|
||||
"ends-with",
|
||||
"path-ends-with",
|
||||
"path-segments",
|
||||
"is-absolute",
|
||||
"is-relative",
|
||||
"parse-filepath"
|
||||
]
|
||||
}
|
||||
},
|
||||
"version": "0.1.0"
|
||||
}
|
||||
Reference in New Issue
Block a user