Galerie und tage
This commit is contained in:
38
node_modules/find-versions/cli.js
generated
vendored
Executable file
38
node_modules/find-versions/cli.js
generated
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
var getStdin = require('get-stdin');
|
||||
var meow = require('meow');
|
||||
var findVersions = require('./');
|
||||
|
||||
var cli = meow([
|
||||
'Usage',
|
||||
' $ find-versions <string> [--first] [--loose]',
|
||||
' $ echo <string> | find-versions',
|
||||
'',
|
||||
'Example',
|
||||
' $ find-versions \'unicorns v1.2.3\'',
|
||||
' 1.2.3',
|
||||
'',
|
||||
' $ curl --version | find-versions --first',
|
||||
' 7.30.0',
|
||||
'',
|
||||
'Options',
|
||||
' --first Return the first match',
|
||||
' --loose Match non-semver versions like 1.88'
|
||||
]);
|
||||
|
||||
function init(data) {
|
||||
var ret = findVersions(data, {loose: cli.flags.loose});
|
||||
console.log(cli.flags.first ? ret[0] : ret.join('\n'));
|
||||
}
|
||||
|
||||
if (process.stdin.isTTY) {
|
||||
if (!cli.input[0]) {
|
||||
console.error('Expected a string');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
init(cli.input[0]);
|
||||
} else {
|
||||
getStdin(init);
|
||||
}
|
||||
31
node_modules/find-versions/index.d.ts
generated
vendored
31
node_modules/find-versions/index.d.ts
generated
vendored
@@ -1,31 +0,0 @@
|
||||
declare namespace findVersions {
|
||||
interface Options {
|
||||
/**
|
||||
Also match non-semver versions like `1.88`. They're coerced into semver compliant versions.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly loose?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`.
|
||||
|
||||
@example
|
||||
```
|
||||
import findVersions = require('find-versions');
|
||||
|
||||
findVersions('unicorn v1.2.3 rainbow 2.3.4+build.1');
|
||||
//=> ['1.2.3', '2.3.4+build.1']
|
||||
|
||||
findVersions('cp (GNU coreutils) 8.22', {loose: true});
|
||||
//=> ['8.22.0']
|
||||
```
|
||||
*/
|
||||
declare function findVersions(
|
||||
stringWithVersions: string,
|
||||
options?: findVersions.Options
|
||||
): string[];
|
||||
|
||||
export = findVersions;
|
||||
19
node_modules/find-versions/index.js
generated
vendored
19
node_modules/find-versions/index.js
generated
vendored
@@ -1,13 +1,18 @@
|
||||
'use strict';
|
||||
const semverRegex = require('semver-regex');
|
||||
var semverRegex = require('semver-regex');
|
||||
var arrayUniq = require('array-uniq');
|
||||
|
||||
module.exports = (stringWithVersions, options = {}) => {
|
||||
if (typeof stringWithVersions !== 'string') {
|
||||
throw new TypeError(`Expected a string, got ${typeof stringWithVersions}`);
|
||||
module.exports = function (str, opts) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
const reLoose = new RegExp(`(?:${semverRegex().source})|(?:v?(?:\\d+\\.\\d+)(?:\\.\\d+)?)`, 'g');
|
||||
const matches = stringWithVersions.match(options.loose === true ? reLoose : semverRegex()) || [];
|
||||
opts = opts || {};
|
||||
|
||||
return [...new Set(matches.map(match => match.trim().replace(/^v/, '').replace(/^\d+\.\d+$/, '$&.0')))];
|
||||
var reLoose = new RegExp('(?:' + semverRegex().source + ')|(?:v?(?:\\d+\\.\\d+)(?:\\.\\d+)?)', 'g');
|
||||
var matches = str.match(opts.loose === true ? reLoose : semverRegex()) || [];
|
||||
|
||||
return arrayUniq(matches.map(function (el) {
|
||||
return el.trim().replace(/^v/, '').replace(/^\d+\.\d+$/, '$&.0');
|
||||
}));
|
||||
};
|
||||
|
||||
20
node_modules/find-versions/license
generated
vendored
20
node_modules/find-versions/license
generated
vendored
@@ -1,9 +1,21 @@
|
||||
MIT License
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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:
|
||||
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 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.
|
||||
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.
|
||||
|
||||
71
node_modules/find-versions/package.json
generated
vendored
71
node_modules/find-versions/package.json
generated
vendored
@@ -1,60 +1,34 @@
|
||||
{
|
||||
"_from": "find-versions@^3.0.0",
|
||||
"_id": "find-versions@3.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==",
|
||||
"_location": "/find-versions",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "find-versions@^3.0.0",
|
||||
"name": "find-versions",
|
||||
"escapedName": "find-versions",
|
||||
"rawSpec": "^3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/bin-version"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz",
|
||||
"_shasum": "10297f98030a786829681690545ef659ed1d254e",
|
||||
"_spec": "find-versions@^3.0.0",
|
||||
"_where": "/var/www/html/jason/WeihnachtenMelly/node_modules/bin-version",
|
||||
"name": "find-versions",
|
||||
"version": "1.2.1",
|
||||
"description": "Find semver versions in a string: `unicorn 1.0.0` → `1.0.0`",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/find-versions",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/find-versions/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"semver-regex": "^2.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`",
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"bin": "cli.js",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
"cli.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/find-versions#readme",
|
||||
"keywords": [
|
||||
"cli-app",
|
||||
"cli",
|
||||
"semver",
|
||||
"version",
|
||||
"versions",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"matching",
|
||||
"semantic",
|
||||
@@ -62,14 +36,13 @@
|
||||
"extract",
|
||||
"get"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "find-versions",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/find-versions.git"
|
||||
"dependencies": {
|
||||
"array-uniq": "^1.0.0",
|
||||
"get-stdin": "^4.0.1",
|
||||
"meow": "^3.5.0",
|
||||
"semver-regex": "^1.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "3.2.0"
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
}
|
||||
}
|
||||
|
||||
55
node_modules/find-versions/readme.md
generated
vendored
55
node_modules/find-versions/readme.md
generated
vendored
@@ -1,22 +1,22 @@
|
||||
# find-versions [](https://travis-ci.com/sindresorhus/find-versions)
|
||||
# find-versions [](https://travis-ci.org/sindresorhus/find-versions)
|
||||
|
||||
> Find semver versions in a string: `unicorn v1.2.3` → `1.2.3`
|
||||
> Find semver versions in a string: `unicorn 1.0.0` → `1.0.0`
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install find-versions
|
||||
$ npm install --save find-versions
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const findVersions = require('find-versions');
|
||||
var findVersions = require('find-versions');
|
||||
|
||||
findVersions('unicorn v1.2.3 rainbow 2.3.4+build.1');
|
||||
//=> ['1.2.3', '2.3.4+build.1']
|
||||
findVersions('unicorn 1.0.0 rainbow v2.3.4+build.1');
|
||||
//=> ['1.0.0', '2.3.4+build.1']
|
||||
|
||||
findVersions('cp (GNU coreutils) 8.22', {loose: true});
|
||||
//=> ['8.22.0']
|
||||
@@ -25,29 +25,48 @@ findVersions('cp (GNU coreutils) 8.22', {loose: true});
|
||||
|
||||
## API
|
||||
|
||||
### findVersions(stringWithVersions, [options])
|
||||
### findVersions(input, options)
|
||||
|
||||
#### stringWithVersions
|
||||
#### input
|
||||
|
||||
*Required*
|
||||
Type: `string`
|
||||
|
||||
#### options
|
||||
#### options.loose
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### loose
|
||||
|
||||
Type: `boolean`
|
||||
Type: `boolean`
|
||||
Default: `false`
|
||||
|
||||
Also match non-semver versions like `1.88`. They're coerced into semver compliant versions.
|
||||
Also match non-semver versions like `1.88`.
|
||||
They're coerced into semver compliant versions.
|
||||
|
||||
|
||||
## Related
|
||||
## CLI
|
||||
|
||||
- [find-versions-cli](https://github.com/sindresorhus/find-versions-cli) - CLI for this module
|
||||
```
|
||||
$ npm install --global find-versions
|
||||
```
|
||||
|
||||
```
|
||||
$ find-versions --help
|
||||
|
||||
Usage
|
||||
$ find-versions <string> [--first] [--loose]
|
||||
$ echo <string> | find-versions
|
||||
|
||||
Example
|
||||
$ find-versions 'unicorns v1.2.3'
|
||||
1.2.3
|
||||
|
||||
$ curl --version | find-versions --first
|
||||
7.30.0
|
||||
|
||||
Options
|
||||
--first Return the first match
|
||||
--loose Match non-semver versions like 1.88
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
||||
|
||||
Reference in New Issue
Block a user