This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015-19 Ionică Bizău <bizauionica@gmail.com> (http://ionicabizau.net)
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
+182 -16
View File
@@ -1,14 +1,52 @@
<!-- 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] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/is-ssh.svg)](https://www.npmjs.com/package/is-ssh) [![Downloads](https://img.shields.io/npm/dt/is-ssh.svg)](https://www.npmjs.com/package/is-ssh) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](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
@@ -20,6 +58,17 @@ yarn add is-ssh
```
## :clipboard: Example
@@ -98,6 +147,12 @@ console.log(isSsh("http://host.xz/path/to/repo.git/"));
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
@@ -117,17 +172,28 @@ console.log(isSsh("file://~/path/to/repo.git/"));
## :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
@@ -143,12 +209,22 @@ Checks if an input value is a ssh url or not.
## :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).
@@ -167,34 +243,124 @@ However, if you get some profit from this or just want to encourage me to contin
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`
- [`bb-git-up`](https://github.com/IonicaBizau/git-up)—A low level git url parser.
- [`bb-parse-url`](https://github.com/IonicaBizau/parse-url)—An advanced url parser supporting git urls too.
- [`git-up`](https://github.com/IonicaBizau/git-up)—A low level git url parser.
- [`miguelcostero-ng2-toasty`](https://github.com/akserg/ng2-toasty) (by Sergey Akopkokhyants)—Angular2 Toasty component shows growl-style alerts and messages for your web app
- [`nodegit-clone`](https://github.com/blond/nodegit-clone#readme) (by Andrew Abramov)—Clone git repository with nodegit
- [`normalize-ssh`](https://github.com/zkochan/normalize-ssh#readme) (by Zoltan Kochan)—Normalize a SSH URL
- [`parse-path`](https://github.com/IonicaBizau/parse-path)—Parse paths (local paths, urls: ssh/git/etc)
- [`parse-url`](https://github.com/IonicaBizau/parse-url)—An advanced url parser supporting git urls too.
## :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
[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(http%3A%2F%2Fionicabizau.net)&year=2015#license-mit
[website]: http://ionicabizau.net
[contributing]: /CONTRIBUTING.md
[docs]: /DOCUMENTATION.md
+6
View File
@@ -73,6 +73,12 @@ console.log(isSsh("http://host.xz/path/to/repo.git/"));
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
+2 -1
View File
@@ -29,7 +29,8 @@ function isSsh(input) {
}
// TODO This probably could be improved :)
return input.indexOf("@") < input.indexOf(":");
var urlPortPattern = new RegExp('\.([a-zA-Z\\d]+):(\\d+)\/');
return !input.match(urlPortPattern) && input.indexOf("@") < input.indexOf(":");
}
module.exports = isSsh;
+13 -13
View File
@@ -1,34 +1,34 @@
{
"_args": [
[
"is-ssh@1.3.1",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"is-ssh@1.4.0",
"/home/node/nuxt"
]
],
"_from": "is-ssh@1.3.1",
"_id": "is-ssh@1.3.1",
"_from": "is-ssh@1.4.0",
"_id": "is-ssh@1.4.0",
"_inBundle": false,
"_integrity": "sha512-0eRIASHZt1E68/ixClI8bp2YK2wmBPVWEismTs6M+M099jKgrzl/3E976zIbImSIob48N2/XGe9y7ZiYdImSlg==",
"_integrity": "sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ==",
"_location": "/is-ssh",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "is-ssh@1.3.1",
"raw": "is-ssh@1.4.0",
"name": "is-ssh",
"escapedName": "is-ssh",
"rawSpec": "1.3.1",
"rawSpec": "1.4.0",
"saveSpec": null,
"fetchSpec": "1.3.1"
"fetchSpec": "1.4.0"
},
"_requiredBy": [
"/git-up",
"/parse-path",
"/parse-url"
],
"_resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.1.tgz",
"_spec": "1.3.1",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz",
"_spec": "1.4.0",
"_where": "/home/node/nuxt",
"author": {
"name": "Ionică Bizău",
"email": "bizauionica@gmail.com",
@@ -38,7 +38,7 @@
"url": "https://github.com/IonicaBizau/node-is-ssh/issues"
},
"dependencies": {
"protocols": "^1.1.0"
"protocols": "^2.0.1"
},
"description": "Check if an input value is a ssh url or not.",
"devDependencies": {
@@ -65,5 +65,5 @@
"scripts": {
"test": "node test"
},
"version": "1.3.1"
"version": "1.4.0"
}
+1 -2
View File
@@ -13,8 +13,7 @@ var input = [
, ["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/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]];