initial commit
This commit is contained in:
66
node_modules/is-ssh/CONTRIBUTING.md
generated
vendored
Normal file
66
node_modules/is-ssh/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
# :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk:
|
||||
|
||||
So, you want to contribute to this project! That's awesome. However, before
|
||||
doing so, please read the following simple steps how to contribute. This will
|
||||
make the life easier and will avoid wasting time on things which are not
|
||||
requested. :sparkles:
|
||||
|
||||
## Discuss the changes before doing them
|
||||
- First of all, open an issue in the repository, using the [bug tracker][1],
|
||||
describing the contribution you would like to make, the bug you found or any
|
||||
other ideas you have. This will help us to get you started on the right
|
||||
foot.
|
||||
|
||||
- If it makes sense, add the platform and software information (e.g. operating
|
||||
system, Node.JS version etc.), screenshots (so we can see what you are
|
||||
seeing).
|
||||
|
||||
- It is recommended to wait for feedback before continuing to next steps.
|
||||
However, if the issue is clear (e.g. a typo) and the fix is simple, you can
|
||||
continue and fix it.
|
||||
|
||||
## Fixing issues
|
||||
- Fork the project in your account and create a branch with your fix:
|
||||
`some-great-feature` or `some-issue-fix`.
|
||||
|
||||
- Commit your changes in that branch, writing the code following the
|
||||
[code style][2]. If the project contains tests (generally, the `test`
|
||||
directory), you are encouraged to add a test as well. :memo:
|
||||
|
||||
- If the project contains a `package.json` or a `bower.json` file add yourself
|
||||
in the `contributors` array (or `authors` in the case of `bower.json`;
|
||||
if the array does not exist, create it):
|
||||
|
||||
```json
|
||||
{
|
||||
"contributors": [
|
||||
"Your Name <and@email.address> (http://your.website)"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Creating a pull request
|
||||
|
||||
- Open a pull request, and reference the initial issue in the pull request
|
||||
message (e.g. *fixes #<your-issue-number>*). Write a good description and
|
||||
title, so everybody will know what is fixed/improved.
|
||||
|
||||
- If it makes sense, add screenshots, gifs etc., so it is easier to see what
|
||||
is going on.
|
||||
|
||||
## Wait for feedback
|
||||
Before accepting your contributions, we will review them. You may get feedback
|
||||
about what should be fixed in your modified code. If so, just keep committing
|
||||
in your branch and the pull request will be updated automatically.
|
||||
|
||||
## Everyone is happy!
|
||||
Finally, your contributions will be merged, and everyone will be happy! :smile:
|
||||
Contributions are more than welcome!
|
||||
|
||||
Thanks! :sweat_smile:
|
||||
|
||||
|
||||
|
||||
[1]: https://github.com/IonicaBizau/node-is-ssh/issues
|
||||
|
||||
[2]: https://github.com/IonicaBizau/code-style
|
||||
14
node_modules/is-ssh/DOCUMENTATION.md
generated
vendored
Normal file
14
node_modules/is-ssh/DOCUMENTATION.md
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
## Documentation
|
||||
|
||||
You can see below the API reference of this module.
|
||||
|
||||
### `isSsh(input)`
|
||||
Checks if an input value is a ssh url or not.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|Array** `input`: The input url or an array of protocols.
|
||||
|
||||
#### Return
|
||||
- **Boolean** `true` if the input is a ssh url, `false` otherwise.
|
||||
|
||||
21
node_modules/is-ssh/LICENSE
generated
vendored
Normal file
21
node_modules/is-ssh/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015-22 Ionică Bizău <bizauionica@gmail.com> (http://ionicabizau.net)
|
||||
|
||||
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.
|
||||
366
node_modules/is-ssh/README.md
generated
vendored
Normal file
366
node_modules/is-ssh/README.md
generated
vendored
Normal file
@@ -0,0 +1,366 @@
|
||||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# is-ssh
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [](https://github.com/IonicaBizau/ama) [](https://www.npmjs.com/package/is-ssh) [](https://www.npmjs.com/package/is-ssh) [](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
|
||||
|
||||
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
> Check if an input value is a ssh url or not.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :cloud: Installation
|
||||
|
||||
```sh
|
||||
# Using npm
|
||||
npm install --save is-ssh
|
||||
|
||||
# Using yarn
|
||||
yarn add is-ssh
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :clipboard: Example
|
||||
|
||||
|
||||
|
||||
```js
|
||||
// Dependencies
|
||||
const isSsh = require("is-ssh");
|
||||
|
||||
// Secure Shell Transport Protocol (SSH)
|
||||
console.log(isSsh("ssh://user@host.xz:port/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://user@host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz:port/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://user@host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://user@host.xz/~user/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz/~user/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://user@host.xz/~/path/to/repo.git"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz/~/path/to/repo.git"));
|
||||
// true
|
||||
|
||||
|
||||
console.log(isSsh("user@host.xz:/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("user@host.xz:~user/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("user@host.xz:path/to/repo.git"));
|
||||
// true
|
||||
|
||||
|
||||
console.log(isSsh("host.xz:/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("host.xz:path/to/repo.git"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("host.xz:~user/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
|
||||
console.log(isSsh("rsync://host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
|
||||
// Git Transport Protocol
|
||||
console.log(isSsh("git://host.xz/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("git://host.xz/~user/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
// HTTP/S Transport Protocol
|
||||
console.log(isSsh("http://host.xz/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("https://host.xz/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("http://host.xz:8000/path/to/repo.git/"))
|
||||
// false
|
||||
|
||||
console.log(isSsh("https://host.xz:8000/path/to/repo.git/"))
|
||||
// false
|
||||
|
||||
// Local (Filesystem) Transport Protocol
|
||||
console.log(isSsh("/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("~/path/to/repo.git"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("file:///path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("file://~/path/to/repo.git/"));
|
||||
// false
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
|
||||
2. For bug reports and feature requests, open issues. :bug:
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
||||
|
||||
### `isSsh(input)`
|
||||
Checks if an input value is a ssh url or not.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|Array** `input`: The input url or an array of protocols.
|
||||
|
||||
#### Return
|
||||
- **Boolean** `true` if the input is a ssh url, `false` otherwise.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :yum: How to contribute
|
||||
Have an idea? Found a bug? See [how to contribute][contributing].
|
||||
|
||||
|
||||
## :sparkling_heart: Support my projects
|
||||
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
|
||||
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
|
||||
|
||||
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
|
||||
|
||||
|
||||
- Starring and sharing the projects you like :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
|
||||
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
|
||||
|
||||

|
||||
|
||||
|
||||
Thanks! :heart:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :dizzy: Where is this library used?
|
||||
If you are using this library in one of your projects, add it in this list. :sparkles:
|
||||
|
||||
- `parse-url`
|
||||
- `git-up`
|
||||
- `nodegit-clone`
|
||||
- `mili`
|
||||
- `@enkeledi/react-native-week-month-date-picker`
|
||||
- `bb-git-up`
|
||||
- `normalize-ssh`
|
||||
- `bb-parse-url`
|
||||
- `xl-git-up`
|
||||
- `@hemith/react-native-tnk`
|
||||
- `miguelcostero-ng2-toasty`
|
||||
- `native-kakao-login`
|
||||
- `npm_one_1_2_3`
|
||||
- `npm-all-packages`
|
||||
- `react-native-biometric-authenticate`
|
||||
- `react-native-arunmeena1987`
|
||||
- `react-native-contact-list`
|
||||
- `react-native-payu-payment-testing`
|
||||
- `react-native-is7`
|
||||
- `react-native-my-first-try-arun-ramya`
|
||||
- `react-native-kakao-maps`
|
||||
- `react-native-ytximkit`
|
||||
- `rn-adyen-dropin`
|
||||
- `@positionex/position-sdk`
|
||||
- `@lakutata/core`
|
||||
- `@corelmax/react-native-my2c2p-sdk`
|
||||
- `@felipesimmi/react-native-datalogic-module`
|
||||
- `@hawkingnetwork/react-native-tab-view`
|
||||
- `install-is`
|
||||
- `drowl-base-theme-iconset`
|
||||
- `native-apple-login`
|
||||
- `react-native-cplus`
|
||||
- `npm_qwerty`
|
||||
- `react-native-bubble-chart`
|
||||
- `react-native-arunjeyam1987`
|
||||
- `react-native-flyy`
|
||||
- `@saad27/react-native-bottom-tab-tour`
|
||||
- `candlelabssdk`
|
||||
- `generator-bootstrap-boilerplate-template`
|
||||
- `@geeky-apo/react-native-advanced-clipboard`
|
||||
- `@apardellass/react-native-audio-stream`
|
||||
- `react-feedback-sdk`
|
||||
- `npm_one_12_34_1_`
|
||||
- `npm_one_2_2`
|
||||
- `react-native-responsive-size`
|
||||
- `react-native-sayhello-module`
|
||||
- `react-native-dsphoto-module`
|
||||
- `payutesting`
|
||||
- `@flareapp/ignition-ui`
|
||||
- `@con-test/react-native-concent-common`
|
||||
- `birken-react-native-community-image-editor`
|
||||
- `clonit`
|
||||
- `luojia-cli-dev`
|
||||
- `reac-native-arun-ramya-test`
|
||||
- `react-native-transtracker-library`
|
||||
- `react-native-pulsator-native`
|
||||
- `react-native-arun-ramya-test`
|
||||
- `react-native-arunramya151`
|
||||
- `react-native-plugpag-wrapper`
|
||||
- `@screeb/react-native`
|
||||
- `@buganto/client`
|
||||
- `react-native-syan-photo-picker`
|
||||
- `@wecraftapps/react-native-use-keyboard`
|
||||
- `angularvezba`
|
||||
- `astra-ufo-sdk`
|
||||
- `l2forlerna`
|
||||
- `native-google-login`
|
||||
- `raact-native-arunramya151`
|
||||
- `react-native-modal-progress-bar`
|
||||
- `react-native-test-module-hhh`
|
||||
- `react-native-badge-control`
|
||||
- `rn-tm-notify`
|
||||
- `react-native-jsi-device-info`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## :scroll: License
|
||||
|
||||
[MIT][license] © [Ionică Bizău][website]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[license]: /LICENSE
|
||||
[website]: http://ionicabizau.net
|
||||
[contributing]: /CONTRIBUTING.md
|
||||
[docs]: /DOCUMENTATION.md
|
||||
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
|
||||
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
|
||||
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
|
||||
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
|
||||
[patreon]: https://www.patreon.com/ionicabizau
|
||||
[amazon]: http://amzn.eu/hRo9sIZ
|
||||
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW
|
||||
96
node_modules/is-ssh/example/index.js
generated
vendored
Normal file
96
node_modules/is-ssh/example/index.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
"use strict";
|
||||
|
||||
// Dependencies
|
||||
var isSsh = require("../lib");
|
||||
|
||||
// Secure Shell Transport Protocol (SSH)
|
||||
console.log(isSsh("ssh://user@host.xz:port/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://user@host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz:port/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://user@host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://user@host.xz/~user/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz/~user/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://user@host.xz/~/path/to/repo.git"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("ssh://host.xz/~/path/to/repo.git"));
|
||||
// true
|
||||
|
||||
|
||||
console.log(isSsh("user@host.xz:/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("user@host.xz:~user/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("user@host.xz:path/to/repo.git"));
|
||||
// true
|
||||
|
||||
|
||||
console.log(isSsh("host.xz:/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("host.xz:path/to/repo.git"));
|
||||
// true
|
||||
|
||||
console.log(isSsh("host.xz:~user/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
|
||||
console.log(isSsh("rsync://host.xz/path/to/repo.git/"));
|
||||
// true
|
||||
|
||||
|
||||
// Git Transport Protocol
|
||||
console.log(isSsh("git://host.xz/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("git://host.xz/~user/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
// HTTP/S Transport Protocol
|
||||
console.log(isSsh("http://host.xz/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("https://host.xz/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("http://host.xz:8000/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("https://host.xz:8000/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
// Local (Filesystem) Transport Protocol
|
||||
console.log(isSsh("/path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("~/path/to/repo.git"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("file:///path/to/repo.git/"));
|
||||
// false
|
||||
|
||||
console.log(isSsh("file://~/path/to/repo.git/"));
|
||||
// false
|
||||
36
node_modules/is-ssh/lib/index.js
generated
vendored
Normal file
36
node_modules/is-ssh/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
|
||||
// Dependencies
|
||||
var protocols = require("protocols");
|
||||
|
||||
/**
|
||||
* isSsh
|
||||
* Checks if an input value is a ssh url or not.
|
||||
*
|
||||
* @name isSsh
|
||||
* @function
|
||||
* @param {String|Array} input The input url or an array of protocols.
|
||||
* @return {Boolean} `true` if the input is a ssh url, `false` otherwise.
|
||||
*/
|
||||
function isSsh(input) {
|
||||
|
||||
if (Array.isArray(input)) {
|
||||
return input.indexOf("ssh") !== -1 || input.indexOf("rsync") !== -1;
|
||||
}
|
||||
|
||||
if (typeof input !== "string") {
|
||||
return false;
|
||||
}
|
||||
|
||||
var prots = protocols(input);
|
||||
input = input.substring(input.indexOf("://") + 3);
|
||||
if (isSsh(prots)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO This probably could be improved :)
|
||||
var urlPortPattern = new RegExp('\.([a-zA-Z\\d]+):(\\d+)\/');
|
||||
return !input.match(urlPortPattern) && input.indexOf("@") < input.indexOf(":");
|
||||
}
|
||||
|
||||
module.exports = isSsh;
|
||||
35
node_modules/is-ssh/package.json
generated
vendored
Normal file
35
node_modules/is-ssh/package.json
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "is-ssh",
|
||||
"version": "1.4.0",
|
||||
"description": "Check if an input value is a ssh url or not.",
|
||||
"main": "lib/index.js",
|
||||
"directories": {
|
||||
"example": "example",
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:IonicaBizau/node-is-ssh.git"
|
||||
},
|
||||
"keywords": [
|
||||
"ssh",
|
||||
"url",
|
||||
"check",
|
||||
"parser"
|
||||
],
|
||||
"author": "Ionică Bizău <bizauionica@gmail.com> (http://ionicabizau.net)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/IonicaBizau/node-is-ssh/issues"
|
||||
},
|
||||
"homepage": "https://github.com/IonicaBizau/node-is-ssh",
|
||||
"dependencies": {
|
||||
"protocols": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tester": "^1.3.1"
|
||||
}
|
||||
}
|
||||
27
node_modules/is-ssh/test/index.js
generated
vendored
Normal file
27
node_modules/is-ssh/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
|
||||
// Dependencies
|
||||
var isSsh = require("../lib"),
|
||||
tester = require("tester");
|
||||
|
||||
// Prepare the input data
|
||||
var input = [
|
||||
// Secure Shell Transport Protocol (SSH)
|
||||
["ssh://user@host.xz:port/path/to/repo.git/", true], ["ssh://user@host.xz/path/to/repo.git/", true], ["ssh://host.xz:port/path/to/repo.git/", true], ["ssh://host.xz/path/to/repo.git/", true], ["ssh://user@host.xz/path/to/repo.git/", true], ["ssh://host.xz/path/to/repo.git/", true], ["ssh://user@host.xz/~user/path/to/repo.git/", true], ["ssh://host.xz/~user/path/to/repo.git/", true], ["ssh://user@host.xz/~/path/to/repo.git", true], ["ssh://host.xz/~/path/to/repo.git", true], ["user@host.xz:/path/to/repo.git/", true], ["user@host.xz:~user/path/to/repo.git/", true], ["user@host.xz:path/to/repo.git", true], ["host.xz:/path/to/repo.git/", true], ["host.xz:path/to/repo.git", true], ["host.xz:~user/path/to/repo.git/", true], ["rsync://host.xz/path/to/repo.git/", true]
|
||||
|
||||
// Git Transport Protocol
|
||||
, ["git://host.xz/path/to/repo.git/", false], ["git://host.xz/~user/path/to/repo.git/", false]
|
||||
|
||||
// HTTP/S Transport Protocol
|
||||
, ["http://host.xz/path/to/repo.git/", false], ["https://host.xz/path/to/repo.git/", false], ["http://host.xz:8000/path/to/repo.git/", false], ["https://host.xz:8000/path/to/repo.git/", false]
|
||||
// Local (Filesystem) Transport Protocol
|
||||
, ["/path/to/repo.git/", false], ["path/to/repo.git/", false], ["~/path/to/repo.git", false], ["file:///path/to/repo.git/", false], ["file://~/path/to/repo.git/", false]];
|
||||
|
||||
tester.describe("check urls", function (test) {
|
||||
// Run the tests
|
||||
input.forEach(function (c) {
|
||||
test.it(c[0] + " is supposed " + (!c[1] ? "not " : "") + "to be a ssh url", function () {
|
||||
test.expect(isSsh(c[0])).toBe(c[1]);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user