diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:38:50 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:40:43 +0200 |
commit | 7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027 (patch) | |
tree | 6de9a1aebd150a23b7f8c273ec657a5d0a18fe3e /node_modules/semver-diff | |
parent | 963b7a41feb29cc4be090a2446bdfe0c1f1bcd81 (diff) | |
download | wallet-core-7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027.tar.xz |
add linting (and some initial fixes)
Diffstat (limited to 'node_modules/semver-diff')
-rw-r--r-- | node_modules/semver-diff/index.js | 27 | ||||
-rw-r--r-- | node_modules/semver-diff/license | 21 | ||||
l--------- | node_modules/semver-diff/node_modules/.bin/semver | 1 | ||||
-rw-r--r-- | node_modules/semver-diff/package.json | 34 | ||||
-rw-r--r-- | node_modules/semver-diff/readme.md | 52 |
5 files changed, 135 insertions, 0 deletions
diff --git a/node_modules/semver-diff/index.js b/node_modules/semver-diff/index.js new file mode 100644 index 000000000..92c9c9700 --- /dev/null +++ b/node_modules/semver-diff/index.js @@ -0,0 +1,27 @@ +'use strict'; +var semver = require('semver'); + +module.exports = function (a, b) { + if (semver.gt(a, b)) { + return null; + } + + a = semver.parse(a); + b = semver.parse(b); + + for (var key in a) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (a[key] !== b[key]) { + return key; + } + } + + if (key === 'prerelease' || key === 'build') { + if (JSON.stringify(a[key]) !== JSON.stringify(b[key])) { + return key; + } + } + } + + return null; +}; diff --git a/node_modules/semver-diff/license b/node_modules/semver-diff/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/semver-diff/license @@ -0,0 +1,21 @@ +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: + +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/semver-diff/node_modules/.bin/semver b/node_modules/semver-diff/node_modules/.bin/semver new file mode 120000 index 000000000..b3ca6032f --- /dev/null +++ b/node_modules/semver-diff/node_modules/.bin/semver @@ -0,0 +1 @@ +../../../semver/bin/semver
\ No newline at end of file diff --git a/node_modules/semver-diff/package.json b/node_modules/semver-diff/package.json new file mode 100644 index 000000000..a62a144a4 --- /dev/null +++ b/node_modules/semver-diff/package.json @@ -0,0 +1,34 @@ +{ + "name": "semver-diff", + "version": "2.1.0", + "description": "Get the diff type of two semver versions: 0.0.1 0.0.2 → patch", + "license": "MIT", + "repository": "sindresorhus/semver-diff", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "semver", + "version", + "semantic", + "diff", + "difference" + ], + "dependencies": { + "semver": "^5.0.3" + }, + "devDependencies": { + "mocha": "*" + } +} diff --git a/node_modules/semver-diff/readme.md b/node_modules/semver-diff/readme.md new file mode 100644 index 000000000..06a172f16 --- /dev/null +++ b/node_modules/semver-diff/readme.md @@ -0,0 +1,52 @@ +# semver-diff [![Build Status](https://travis-ci.org/sindresorhus/semver-diff.svg?branch=master)](https://travis-ci.org/sindresorhus/semver-diff) + +> Get the diff type of two [semver](https://github.com/isaacs/node-semver) versions: `0.0.1 0.0.2` → `patch` + + +## Install + +```sh +$ npm install --save semver-diff +``` + + +## Usage + +```js +var semverDiff = require('semver-diff'); + +semverDiff('1.1.1', '1.1.2'); +//=> 'patch' + +semverDiff('0.0.1', '1.0.0'); +//=> 'major' + +semverDiff('0.0.1', '0.1.0'); +//=> 'minor' + +semverDiff('0.0.1-foo', '0.0.1-foo.bar'); +//=> 'prerelease' + +semverDiff('0.1.0', '0.1.0+foo'); +//=> 'build' + +semverDiff('0.0.1', '0.0.1'); +//=> null + +semverDiff('0.0.2', '0.0.1'); +//=> null +``` + + +## API + +### semverDiff(versionA, versionB) + +Returns the difference type between two semver versions, or `null` if they're identical or the second one is lower than the first. + +Possible values: `'major'`, `'minor'`, `'patch'`, `'prerelease'`, `'build'`, `null`. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) |