diff --git a/README.md b/README.md index 03ca384..8782fc5 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ An open source chat client - child_process - showdown - open +- proxysocket # Chat formatting - Bold: `*` diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md index a5aa347..ea5db6c 100644 --- a/node_modules/@types/node/README.md +++ b/node_modules/@types/node/README.md @@ -8,7 +8,7 @@ This package contains type definitions for Node.js ( http://nodejs.org/ ). Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v10 Additional Details - * Last updated: Fri, 22 Mar 2019 19:04:50 GMT + * Last updated: Mon, 25 Mar 2019 20:44:51 GMT * Dependencies: none * Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, require, setImmediate, setInterval, setTimeout diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts index 0d23809..06ebb77 100644 --- a/node_modules/@types/node/http2.d.ts +++ b/node_modules/@types/node/http2.d.ts @@ -415,7 +415,7 @@ declare module "http2" { peerMaxConcurrentStreams?: number; selectPadding?: (frameLen: number, maxFrameLen: number) => number; settings?: Settings; - createConnection?: (option: SessionOptions) => stream.Duplex; + createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex; } export type ClientSessionOptions = SessionOptions; diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index 2b8a2f5..3c89d1e 100644 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -7,13 +7,13 @@ ], "_from": "@types/node@>=10.12.18 <11.0.0", "_hasShrinkwrap": false, - "_id": "@types/node@10.14.3", + "_id": "@types/node@10.14.4", "_inCache": true, "_installable": true, "_location": "/@types/node", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/node_10.14.3_1553281537097_0.4008256498353169" + "tmp": "tmp/node_10.14.4_1553546752808_0.2256543266238944" }, "_npmUser": { "email": "ts-npm-types@microsoft.com", @@ -31,8 +31,8 @@ "_requiredBy": [ "/electron" ], - "_resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.3.tgz", - "_shasum": "170a81168620d931cc3b83460be253cadd3028f1", + "_resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", + "_shasum": "1c586b991457cbb58fef51bc4e0cfcfa347714b5", "_shrinkwrap": null, "_spec": "@types/node@^10.12.18", "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client/node_modules/electron", @@ -187,11 +187,11 @@ "directories": {}, "dist": { "fileCount": 49, - "integrity": "sha512-2lhc7S28vo8FwR3Jv3Ifyd77AxEsx+Nl9ajWiac6/eWuvZ84zPK4RE05pfqcn3acIzlZDpQj5F1rIKQZX3ptLQ==", - "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJclTIBCRA9TVsSAnZWagAA554P/R2wC05nwJZd1YdVz+JD\n8+daXtOmLI+mp+mywWrrSnLfOKRDPbD/R6tye0FS3FkyEpvLilaohSb3Xhdp\nIFYhF3WqZAlKzupvEooByrVZOtjvcVUiAXgnLDJivDa54PRIeyzlmfArHj0r\n/GKXYj/SxSxaLpAbYAnAB5Y6ismCo+uQzzLlu6Cn30HhgWGyOzhzgdN6iFdb\nrAFjAfQexz/ubS2oYQjAtUkbXtQvgya0DgAiYqXAzHQ7GhdcN4OyLg79BTy1\nHjpilhoe2jUok9L0pEkfeDzYMcwph7Sb5Ms/kl66ffnVPRl7cHZTdF5YtetC\n+9somxuqRh6GaV9wiDtELY2AgppFz39y6F/OW38ixltasJ5+mqGNwK3Ntkgb\ntwwD7IUZpWyALXN7lNLv2PRvXLTXPMohBbs7eBe9Ih0d2rBzrBbqHIN0h+5v\n8BgYRncqwNO7Kh9xU6xLjr4Qv4FMt7WdCAGFY7LjlO7cYhDhNw3rqZfA97AZ\nyUCxxUHZSDhdNpXd23/whjvEFZCM8lsVLcAWggHYdRxhFdN/tqLqcRCGavnD\nwFSK8CvNiVLG/VT/+mUnBY6pyoy7N+b6cGbZ1aNGbslRee+WI9u0QvMTdZ+z\ngbOzQLEwWfN5eLeTg8YAEW73vmOuwYXziEOWsn0xInrUnrgaaC1XNWkUYZ4o\nWvin\r\n=pqQ1\r\n-----END PGP SIGNATURE-----\r\n", - "shasum": "170a81168620d931cc3b83460be253cadd3028f1", - "tarball": "https://registry.npmjs.org/@types/node/-/node-10.14.3.tgz", - "unpackedSize": 587809 + "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==", + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcmT4BCRA9TVsSAnZWagAAnm0P/R/Sf9l7qrV0iRi4H+UA\nosAMYySBXdI/0bHmbrx3HrV4ZV9k4YCWRQEKh1v4ZGOVIEohk+YnshN0rJMq\nwVBTWEa7gRDSSIZM/DJpKEwJetjItGcx54PTcO+xsR/mnGd1eiJ9jYGFWeSC\nCu+1oyT8FzyuvyQQQBljWWrlH3X1J+kuVXIV3by1vk9r61koW7zomRXgwvHV\nmqGdLUuI+s3MqsPjkoazEDkJKUy34/x5F2w0rlw9rUrrvO8OU26rtFqtFiZc\nNcMLT6/03q87wHfxciiBcBuK4fw5y+C30kXSC95XIri9CpaQFR0zOipg183c\nVPICeQUATXIdrztg2/K87sEDNaVYkgq39XgqSKRMDSQ58gDOJyp+ZijuNqVi\nweh2YoRiI2TmuuGkkV96bw0CT/NQjIGUh5bnl4evBwApkbkabzeL/F2BCxRe\nR4E4OdVZ66OvEJnWWBgGatPCL2SgkAl8YweEdDKKrTFoA7n4qFk6B9Rn6fEL\nTGgN0YsNjVGSgTibdx2320iIEF5oEHnH3jghRNatZqUQ0W+IeOEF0fRoEZFB\nSUeYOw8UrMQWq9eo8bfQ6zKkWj/G7epBvIi4CnhB3AXqZdppUy5CJKirlGMe\nN2PTr6DaDdheEUagieV7fIx2qE+MtT6zO1YtrA+CbrbF0MqXCxtzhRYZVFFO\nd/t2\r\n=CuMQ\r\n-----END PGP SIGNATURE-----\r\n", + "shasum": "1c586b991457cbb58fef51bc4e0cfcfa347714b5", + "tarball": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", + "unpackedSize": 587829 }, "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme", "license": "MIT", @@ -213,7 +213,7 @@ "scripts": {}, "typeScriptVersion": "2.0", "types": "index", - "typesPublisherContentHash": "9231104d3906ef64b05d31ef1da631828d13f79c4bbdb7ec3cc282f9c72e9b8d", + "typesPublisherContentHash": "c8fceade63ae6a80f82d8f55d0c8cd1fa69fb8725edc586c0c2de1bda3dada8d", "typesVersions": { ">=3.2.0-0": { "*": [ @@ -221,5 +221,5 @@ ] } }, - "version": "10.14.3" + "version": "10.14.4" } diff --git a/node_modules/electron/dist/electron b/node_modules/electron/dist/electron index 4de25c6..bba25c4 100644 Binary files a/node_modules/electron/dist/electron and b/node_modules/electron/dist/electron differ diff --git a/node_modules/electron/dist/icudtl.dat b/node_modules/electron/dist/icudtl.dat index 4ba503b..2b2bc0a 100644 Binary files a/node_modules/electron/dist/icudtl.dat and b/node_modules/electron/dist/icudtl.dat differ diff --git a/node_modules/electron/dist/resources/electron.asar b/node_modules/electron/dist/resources/electron.asar index 17a2734..7c0b08e 100644 Binary files a/node_modules/electron/dist/resources/electron.asar and b/node_modules/electron/dist/resources/electron.asar differ diff --git a/node_modules/electron/dist/v8_context_snapshot.bin b/node_modules/electron/dist/v8_context_snapshot.bin index 0daa7bf..3d70e40 100644 Binary files a/node_modules/electron/dist/v8_context_snapshot.bin and b/node_modules/electron/dist/v8_context_snapshot.bin differ diff --git a/node_modules/electron/dist/version b/node_modules/electron/dist/version index 2582ddd..9d086c6 100644 --- a/node_modules/electron/dist/version +++ b/node_modules/electron/dist/version @@ -1 +1 @@ -4.1.1 \ No newline at end of file +4.1.4 \ No newline at end of file diff --git a/node_modules/electron/electron.d.ts b/node_modules/electron/electron.d.ts index bf648e6..e074449 100644 --- a/node_modules/electron/electron.d.ts +++ b/node_modules/electron/electron.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron 4.1.1 +// Type definitions for Electron 4.1.4 // Project: http://electronjs.org/ // Definitions by: The Electron Team // Definitions: https://github.com/electron/electron-typescript-definitions @@ -2403,7 +2403,8 @@ declare namespace Electron { // Docs: http://electronjs.org/docs/api/structures/cookie /** - * The domain of the cookie. + * The domain of the cookie; this will be normalized with a preceding dot so that + * it's also valid for subdomains. */ domain?: string; /** @@ -2412,7 +2413,8 @@ declare namespace Electron { */ expirationDate?: number; /** - * Whether the cookie is a host-only cookie. + * Whether the cookie is a host-only cookie; this will only be true if no domain + * was passed. */ hostOnly?: boolean; /** @@ -2559,8 +2561,10 @@ declare namespace Electron { */ addExtraParameter(key: string, value: string): void; /** - * Returns the date and ID of the last crash report. If no crash reports have been - * sent or the crash reporter has not been started, null is returned. + * Returns the date and ID of the last crash report. Only crash reports that have + * been uploaded will be returned; even if a crash report is present on disk it + * will not be returned until it is uploaded. In the case that there are no + * uploaded reports, null is returned. */ getLastCrashReport(): CrashReport; /** @@ -7857,7 +7861,8 @@ declare namespace Electron { */ value?: string; /** - * The domain of the cookie. Empty by default if omitted. + * The domain of the cookie; this will be normalized with a preceding dot so that + * it's also valid for subdomains. Empty by default if omitted. */ domain?: string; /** diff --git a/node_modules/electron/package.json b/node_modules/electron/package.json index 31995f0..4b7b882 100644 --- a/node_modules/electron/package.json +++ b/node_modules/electron/package.json @@ -1,13 +1,13 @@ { "_args": [ [ - "electron", + "electron@^4.1.1", "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client" ] ], - "_from": "electron@latest", + "_from": "electron@>=4.1.1 <5.0.0", "_hasShrinkwrap": false, - "_id": "electron@4.1.1", + "_id": "electron@4.1.4", "_inCache": true, "_installable": true, "_integrity": "", @@ -15,7 +15,7 @@ "_nodeVersion": "10.15.3", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/electron_4.1.1_1553123425190_0.6579966637880585" + "tmp": "tmp/electron_4.1.4_1554411637100_0.47467981818900107" }, "_npmUser": { "email": "info@electronjs.org", @@ -25,20 +25,19 @@ "_phantomChildren": {}, "_requested": { "name": "electron", - "raw": "electron", - "rawSpec": "", + "raw": "electron@^4.1.1", + "rawSpec": "^4.1.1", "scope": null, - "spec": "latest", - "type": "tag" + "spec": ">=4.1.1 <5.0.0", + "type": "range" }, "_requiredBy": [ - "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/electron/-/electron-4.1.1.tgz", - "_shasum": "dc9343ba829cabbf01364761e72796f766704184", + "_resolved": "https://registry.npmjs.org/electron/-/electron-4.1.4.tgz", + "_shasum": "41ba9e041f38c25c62a7db806884410654df058f", "_shrinkwrap": null, - "_spec": "electron", + "_spec": "electron@^4.1.1", "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client", "author": { "name": "Electron Community" @@ -65,11 +64,11 @@ }, "dist": { "fileCount": 7, - "integrity": "sha512-ABIEXTw55eiCW30a6F8fWLHL0QeH+yK3JgZpvTZZWLnkO5/SmG38avMxRhKOUQstRpYb+EEpE8IAM2DVOaTvtw==", - "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJckshiCRA9TVsSAnZWagAAzgIP/23Si3Fx6NiFC2x8/Rxe\naFnogF5yIACdj5qw7TjoNL3lvciEmMSrQNIFS4POgGCxXMgmG/a2cdrVfXiv\nMAwsVQ49PjxmgpDh5wJCc8iQtR2bCr1IQDnP/SBGDQe2cpUzXuqw0tBQ7uDO\n6180VL+j8Nttz+tpRgUJuHb/LGgBh8y4gFHf9P2NwBTzLVNI1i6cSxChKzqX\nGp0U8zCL19zINu4esJwks26VbXpX2XzJ1z22/cIAy+AiYVHX7szj3zhjT0CE\nanSI/82Ytvjy42Gx8CeQLfxOcsbrIrPglAp0m44riqUUhYFE+8lzySc7aO+U\n7fkhOUGpJzDOYUrRaCa5lQncdXJVrAfvkFbbjSKfEb2wLBX5dA/dU67Vz/pO\nb7J/6DjbWtEhkuZp7mwNbYiQ5UPYxwbdZhRf8hJuOytgqN6hTtcdPTGIIonO\nxXbC9AAy1DSkRS6+WbS6jlhcf/8XuQOM48dN/D78HX27ZM++wNeq3ix2JKfF\n3rOxuvVzV3Wi2aNjUqEWiKAxQD9gyuZG+/bGUZmfKyJV3YCsYrLP2Wj3n6ZP\nB1iZsvuBxzvmnIVmeVonukbYBtNDO7TUT0/Vn+nXGGc1nQoD7PFKYeQvAKsw\n8ZF7MAsukcEZhC7aFj57e3br4RZn5dKRwwPHfAkqQRJ5KskjlCDxAkmJ44JD\nbw4r\r\n=nRxf\r\n-----END PGP SIGNATURE-----\r\n", - "shasum": "dc9343ba829cabbf01364761e72796f766704184", - "tarball": "https://registry.npmjs.org/electron/-/electron-4.1.1.tgz", - "unpackedSize": 424140 + "integrity": "sha512-MelOjntJvd33izEjR6H4N/Uii7y535z/b2BuYXJGLNSHL6o1IlyhUQmfiT87kWABayERgeuYERgvsyf956OOFw==", + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpnB1CRA9TVsSAnZWagAA/RoP/igdqYaBkNd2D22ZTvVI\nCii6zTlf7hxmNI890sY6vJHf8VPyz3AjZZ2cOlDlfdSAxn82hYsfJgQhfiuw\nROOC/ogP6g1RRFW/WkhRz7mo37gp8pa/UZqZR6aarKXdCI/j1b/4g7LFpbds\njNzkVAMUykJ/LsmlHPJwnNAslDotJHOk9PhSoWF2NkSvCHL2ZXYICppzWkhn\nuXDKKLAnDzpN0+4HhiAanoC7lICUBJJ28Lsa/zPoXVPuMfuvHym8e+EyUtyP\ncY8f1x2V5OkWg/eZoW/WuqqKOIdN5THPWg0n08+0maNspuwj4e/nioIcVA7d\n+Hu9fs55P9J/U3DD0YQjtC9HfdAz5+f9fCyW+GD5fnDPhHRGVYpVw0SkxtHv\n7x/x8h9Rv6fCHrz3qpsSjjv7MT9NheD0s2GAwK5GD+cCaAh6hAJCg/8EpN2E\nD2oWLVgv6pRqkqgHtQoLF3vfIaJVR0wmLuZSiCOf/M49jjAEEUzzzyGV8HZe\n9Bz3NyOEnUs+nWhxAkz0pgcBDa458hlY91nY71IhU6bd17wpmy2hIVklp+YA\nolUgP3oelB3jFexs2Or8tgT4pdW8dwaXWsJbv/DvZYeEJgw6mp2f43Mo+Nj0\nYb5EnnEfczorMIJhDHSr33S9lY5iGZFerRyIXWMx/97fLd0QcXT/J1t6KPNM\nD8VZ\r\n=qvXu\r\n-----END PGP SIGNATURE-----\r\n", + "shasum": "41ba9e041f38c25c62a7db806884410654df058f", + "tarball": "https://registry.npmjs.org/electron/-/electron-4.1.4.tgz", + "unpackedSize": 424511 }, "engines": { "node": ">= 4.0" @@ -92,7 +91,8 @@ ], "name": "electron", "optionalDependencies": {}, - "readme": "ERROR: No README data found!", + "readme": "[![Electron Logo](https://electronjs.org/images/electron-logo.svg)](https://electronjs.org)\n\n\n[![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/master.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/master)\n[![AppVeyor Build Status](https://windows-ci.electronjs.org/api/projects/status/nilyf07hcef14dvj/branch/master?svg=true)](https://windows-ci.electronjs.org/project/AppVeyor/electron/branch/master)\n[![devDependency Status](https://david-dm.org/electron/electron/dev-status.svg)](https://david-dm.org/electron/electron?type=dev)\n[![Join the Electron Community on Slack](https://atom-slack.herokuapp.com/badge.svg)](https://atom-slack.herokuapp.com/)\n\n:memo: Available Translations: 🇨🇳 🇹🇼 🇧🇷 🇪🇸 🇰🇷 🇯🇵 🇷🇺 🇫🇷 🇹🇭 🇳🇱 🇹🇷 🇮🇩 🇺🇦 🇨🇿 🇮🇹.\nView these docs in other languages at [electron/i18n](https://github.com/electron/i18n/tree/master/content/).\n\nThe Electron framework lets you write cross-platform desktop applications\nusing JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org/) and\n[Chromium](https://www.chromium.org) and is used by the [Atom\neditor](https://github.com/atom/atom) and many other [apps](https://electronjs.org/apps).\n\nFollow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important\nannouncements.\n\nThis project adheres to the Contributor Covenant\n[code of conduct](https://github.com/electron/electron/tree/master/CODE_OF_CONDUCT.md).\nBy participating, you are expected to uphold this code. Please report unacceptable\nbehavior to [coc@electronjs.org](mailto:coc@electronjs.org).\n\n## Installation\n\nTo install prebuilt Electron binaries, use [`npm`](https://docs.npmjs.com/).\nThe preferred method is to install Electron as a development dependency in your\napp:\n\n```sh\nnpm install electron --save-dev [--save-exact]\n```\n\nThe `--save-exact` flag is recommended for Electron prior to version 2, as it does not follow semantic\nversioning. As of version 2.0.0, Electron follows semver, so you don't need `--save-exact` flag. For info on how to manage Electron versions in your apps, see\n[Electron versioning](docs/tutorial/electron-versioning.md).\n\nFor more installation options and troubleshooting tips, see\n[installation](docs/tutorial/installation.md).\n\n## Quick start & Electron Fiddle\n\nUse [`Electron Fiddle`](https://github.com/electron/fiddle)\nto build, run, and package small Electron experiments, to see code examples for all of Electron's APIs, and\nto try out different versions of Electron. It's designed to make the start of your journey with\nElectron easier.\n\nAlternatively, clone and run the\n[electron/electron-quick-start](https://github.com/electron/electron-quick-start)\nrepository to see a minimal Electron app in action:\n\n```sh\ngit clone https://github.com/electron/electron-quick-start\ncd electron-quick-start\nnpm install\nnpm start\n```\n\n## Resources for learning Electron\n\n- [electronjs.org/docs](https://electronjs.org/docs) - all of Electron's documentation\n- [electron/fiddle](https://github.com/electron/fiddle) - A tool to build, run, and package small Electron experiments\n- [electron/electron-quick-start](https://github.com/electron/electron-quick-start) - a very basic starter Electron app\n- [electronjs.org/community#boilerplates](https://electronjs.org/community#boilerplates) - sample starter apps created by the community\n- [electron/simple-samples](https://github.com/electron/simple-samples) - small applications with ideas for taking them further\n- [electron/electron-api-demos](https://github.com/electron/electron-api-demos) - an Electron app that teaches you how to use Electron\n- [hokein/electron-sample-apps](https://github.com/hokein/electron-sample-apps) - small demo apps for the various Electron APIs\n\n## Programmatic usage\n\nMost people use Electron from the command line, but if you require `electron` inside\nyour **Node app** (not your Electron app) it will return the file path to the\nbinary. Use this to spawn Electron from Node scripts:\n\n```javascript\nconst electron = require('electron')\nconst proc = require('child_process')\n\n// will print something similar to /Users/maf/.../Electron\nconsole.log(electron)\n\n// spawn Electron\nconst child = proc.spawn(electron)\n```\n\n### Mirrors\n\n- [China](https://npm.taobao.org/mirrors/electron)\n\n## Documentation Translations\n\nFind documentation translations in [electron/i18n](https://github.com/electron/i18n).\n\n## Community\n\nInfo on reporting bugs, getting help, finding third-party tools and sample apps,\nand more can be found in the [support document](docs/tutorial/support.md#finding-support).\n\n## License\n\n[MIT](https://github.com/electron/electron/blob/master/LICENSE)\n\nWhen using the Electron or other GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).\n", + "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/electron/electron.git" @@ -104,5 +104,5 @@ "test": "standard" }, "types": "electron.d.ts", - "version": "4.1.1" + "version": "4.1.4" } diff --git a/node_modules/mime-db/HISTORY.md b/node_modules/mime-db/HISTORY.md index 577194c..a4a0a68 100644 --- a/node_modules/mime-db/HISTORY.md +++ b/node_modules/mime-db/HISTORY.md @@ -1,3 +1,9 @@ +1.39.0 / 2019-04-04 +=================== + + * Add extensions `.siv` and `.sieve` to `application/sieve` + * Add new upstream MIME types + 1.38.0 / 2019-02-04 =================== diff --git a/node_modules/mime-db/db.json b/node_modules/mime-db/db.json index ba4db79..2cc4313 100644 --- a/node_modules/mime-db/db.json +++ b/node_modules/mime-db/db.json @@ -102,6 +102,18 @@ "compressible": true, "extensions": ["atomsvc"] }, + "application/atsc-dwd+xml": { + "source": "iana", + "compressible": true + }, + "application/atsc-held+xml": { + "source": "iana", + "compressible": true + }, + "application/atsc-rsat+xml": { + "source": "iana", + "compressible": true + }, "application/atxml": { "source": "iana" }, @@ -801,6 +813,10 @@ "application/mikey": { "source": "iana" }, + "application/mmt-aei+xml": { + "source": "iana", + "compressible": true + }, "application/mmt-usd+xml": { "source": "iana", "compressible": true @@ -939,6 +955,9 @@ "source": "apache", "extensions": ["onetoc","onetoc2","onetmp","onepkg"] }, + "application/oscore": { + "source": "iana" + }, "application/oxps": { "source": "iana", "extensions": ["oxps"] @@ -1314,7 +1333,8 @@ "extensions": ["shf"] }, "application/sieve": { - "source": "iana" + "source": "iana", + "extensions": ["siv","sieve"] }, "application/simple-filter+xml": { "source": "iana", @@ -6552,6 +6572,10 @@ "compressible": false, "extensions": ["jpx","jpf"] }, + "image/jxr": { + "source": "iana", + "extensions": ["jxr"] + }, "image/ktx": { "source": "iana", "extensions": ["ktx"] diff --git a/node_modules/mime-db/package.json b/node_modules/mime-db/package.json index f155837..05010bb 100644 --- a/node_modules/mime-db/package.json +++ b/node_modules/mime-db/package.json @@ -1,20 +1,20 @@ { "_args": [ [ - "mime-db@~1.38.0", + "mime-db@~1.39.0", "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client/node_modules/mime-types" ] ], - "_from": "mime-db@>=1.38.0 <1.39.0", + "_from": "mime-db@>=1.39.0 <1.40.0", "_hasShrinkwrap": false, - "_id": "mime-db@1.38.0", + "_id": "mime-db@1.39.0", "_inCache": true, "_installable": true, "_location": "/mime-db", - "_nodeVersion": "8.15.0", + "_nodeVersion": "8.15.1", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/mime-db_1.38.0_1549336832525_0.9039233421831574" + "tmp": "tmp/mime-db_1.39.0_1554430122853_0.8714978089749246" }, "_npmUser": { "email": "doug@somethingdoug.com", @@ -24,19 +24,19 @@ "_phantomChildren": {}, "_requested": { "name": "mime-db", - "raw": "mime-db@~1.38.0", - "rawSpec": "~1.38.0", + "raw": "mime-db@~1.39.0", + "rawSpec": "~1.39.0", "scope": null, - "spec": ">=1.38.0 <1.39.0", + "spec": ">=1.39.0 <1.40.0", "type": "range" }, "_requiredBy": [ "/mime-types" ], - "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "_shasum": "1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad", + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.39.0.tgz", + "_shasum": "f95a20275742f7d2ad0429acfe40f4233543780e", "_shrinkwrap": null, - "_spec": "mime-db@~1.38.0", + "_spec": "mime-db@~1.39.0", "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client/node_modules/mime-types", "bugs": { "url": "https://github.com/jshttp/mime-db/issues" @@ -60,35 +60,35 @@ "dependencies": {}, "description": "Media Type Database", "devDependencies": { - "bluebird": "3.5.3", + "bluebird": "3.5.4", "co": "4.6.0", "cogent": "1.0.1", "csv-parse": "3.2.0", - "eslint": "5.13.0", + "eslint": "5.16.0", "eslint-config-standard": "12.0.0", "eslint-plugin-import": "2.16.0", "eslint-plugin-node": "7.0.1", - "eslint-plugin-promise": "4.0.1", + "eslint-plugin-promise": "4.1.1", "eslint-plugin-standard": "4.0.0", "gnode": "0.1.2", - "mocha": "5.2.0", - "nyc": "13.2.0", + "mocha": "6.0.2", + "nyc": "13.3.0", "raw-body": "2.3.3", "stream-to-array": "2.3.0" }, "directories": {}, "dist": { "fileCount": 6, - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", - "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWQEBCRA9TVsSAnZWagAAXSMP/jBFEA8x96QJ4p1cuvDi\nSObsmuQxGC2HcOHu8P2FuyCjCG4cWgjQT2ANKdGG8nOAvpZbU9D23pw6zj4y\nx2zrUi5rSU924LCXhfXx/YlOevYlSbV4E/eU0ZsvuCDbR3KuRsOi+8U/gFIO\nKgnJIygONbg+czoK5CKofBn4yI/0z9AfHPl1ZxiMLPQHpziAMaW2N221mHia\nIw1WJ3WttXvjoemrduN0fwfuB11plAgo9p1W8H1vSLmGFN8M6pbvMRLd2H5N\nGUy1F3sucis6+48Bcbcr9W7W/OeMh9UfbGfvzptV1MYjqNkXb/vYJzGyMBeR\nGwOkjMJW/JE7WpwMzRpzUDeBazBnqw1boRHhZlFTRaIfsz0USnetkuKgnBTp\n+z8/sepMrlIIHtWv5E4swSEJ3tR0RSdFLn3MYQUrqARKg9xLhTf2Dt28ES2m\nNy5USUFglIWbeh0p6CrbTHrUH06jsO43kIJo5j+YbfrV/q+hgs01OXQxGsS3\nI2Aqz9ZIrGZHd/qHCXFjyLO2SW6Qhk4/+JscF3vSK/axmo1rbD3vmN2BwjNi\nodiMNaGJwXyh+OYJpPZoBh+VARcOoD6w+lWrbmX1FdAxpW0s48bmB6OK/SVe\nCvix+hsokZTN6/saFxZ4xcEkUVHLxlapRWIbfaxP/6Zxm3etlSiQY0XyGrA2\nkzzo\r\n=Obtw\r\n-----END PGP SIGNATURE-----\r\n", - "shasum": "1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad", - "tarball": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "unpackedSize": 187036 + "integrity": "sha512-DTsrw/iWVvwHH+9Otxccdyy0Tgiil6TWK/xhfARJZF/QFhwOgZgOIvA2/VIGpM8U7Q8z5nDmdDWC6tuVMJNibw==", + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcprirCRA9TVsSAnZWagAAiV4QAJo09LTUiZBT9ela3OSr\nk5RB9/Z3QQnbOdFuoqQe8EtgP0jUli6/JY6QEc4HD38IuItqe5HuCBH5m0nn\n847UJF4bAHGHcIpVrUClsu3nTh8OPATmXoYqUxKianVE7aJ8YCBPjPQN6JHJ\nIFT/XI3eshE0qrCJmWlhNG54cHr8LDVHVnuG8fG/l08lXKq9cljj93G5Tq32\nscrNgUqcRfE9Csq+Er678c+N+V+FXgr5X1AOEqcytLz/zmSP2cH12eL+6ndJ\nzx5sM5FG9Bjrdib6RyixvuKBX41TsTGkVTWkMw3hADfuckT1j00WOsAqM9yh\np8AWE9uxZl1pJ438m7W3HMRK+aVVcwbjj1rSIKIBj69/P2vIe5+PSS7qaOkD\nLpW5eYFEiVLrxFMOPccpUbbKaB+hkF/5eqxo0eFib+g+xLkYQei3jf6n+iVg\nZQITvj4UXv1/kPxPfmHrK8HRHN7irak5sRFqdgyCqM4uOrbW5451TJF6sIM3\nfpYK910N7tU6wVOpOZv65wc0s/Z4n2p+evXjWyaY0DzOmbyA6Y6u6daWzsfD\nUv0j/P/xFfAoYuNXJo6vXAIQjlMCbpp1uuVrKu8xSLtQolY8OtQX3/I5Iuuy\nRdjEhacp2dCJKbWmc9WGUjG450OsD22CIe9yHxeswugo7oNBOLtPaDbARS66\nz2xU\r\n=B2vL\r\n-----END PGP SIGNATURE-----\r\n", + "shasum": "f95a20275742f7d2ad0429acfe40f4233543780e", + "tarball": "https://registry.npmjs.org/mime-db/-/mime-db-1.39.0.tgz", + "unpackedSize": 187666 }, "engines": { "node": ">= 0.6" }, - "gitHead": "73802502feea4d2ec25f8a5f1a8d4b1d64a8ed69", + "gitHead": "8beb4223f9c8d0e36f438747359f0f6465cfd0b7", "homepage": "https://github.com/jshttp/mime-db#readme", "keywords": [ "charset", @@ -127,5 +127,5 @@ "update": "npm run fetch && npm run build", "version": "node scripts/version-history.js && git add HISTORY.md" }, - "version": "1.38.0" + "version": "1.39.0" } diff --git a/node_modules/mime-types/HISTORY.md b/node_modules/mime-types/HISTORY.md index 133399b..90b480e 100644 --- a/node_modules/mime-types/HISTORY.md +++ b/node_modules/mime-types/HISTORY.md @@ -1,3 +1,10 @@ +2.1.23 / 2019-04-17 +=================== + + * deps: mime-db@~1.39.0 + - Add extensions `.siv` and `.sieve` to `application/sieve` + - Add new upstream MIME types + 2.1.22 / 2019-02-14 =================== diff --git a/node_modules/mime-types/package.json b/node_modules/mime-types/package.json index 72c1670..ebd67d5 100644 --- a/node_modules/mime-types/package.json +++ b/node_modules/mime-types/package.json @@ -7,14 +7,14 @@ ], "_from": "mime-types@>=2.1.19 <2.2.0", "_hasShrinkwrap": false, - "_id": "mime-types@2.1.22", + "_id": "mime-types@2.1.23", "_inCache": true, "_installable": true, "_location": "/mime-types", - "_nodeVersion": "8.15.0", + "_nodeVersion": "8.15.1", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/mime-types_2.1.22_1550184458136_0.07147731380368416" + "tmp": "tmp/mime-types_2.1.23_1555562474870_0.5469095710208383" }, "_npmUser": { "email": "doug@somethingdoug.com", @@ -34,8 +34,8 @@ "/form-data", "/request" ], - "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "_shasum": "fe6b355a190926ab7698c9a0556a11199b2199bd", + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.23.tgz", + "_shasum": "d4eacd87de99348a6858fe1e479aad877388d977", "_shrinkwrap": null, "_spec": "mime-types@~2.1.19", "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client/node_modules/request", @@ -59,32 +59,32 @@ } ], "dependencies": { - "mime-db": "~1.38.0" + "mime-db": "~1.39.0" }, "description": "The ultimate javascript content-type utility.", "devDependencies": { - "eslint": "5.13.0", + "eslint": "5.16.0", "eslint-config-standard": "12.0.0", - "eslint-plugin-import": "2.16.0", - "eslint-plugin-node": "7.0.1", - "eslint-plugin-promise": "4.0.1", + "eslint-plugin-import": "2.17.2", + "eslint-plugin-node": "8.0.1", + "eslint-plugin-promise": "4.1.1", "eslint-plugin-standard": "4.0.0", - "mocha": "5.2.0", - "nyc": "13.3.0" + "mocha": "6.1.3", + "nyc": "14.0.0" }, "directories": {}, "dist": { "fileCount": 5, - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", - "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZfAKCRA9TVsSAnZWagAAkLQP/jW4lBe78qBJSqi0BdL3\nbvjlEBy3K8HNUwrGAPhw36ooYolZtw6mZET7Ylm0taGaWYz7IPrGwmGK3TB3\nUE+OZPGEiolp+cSybxdo3eX3/AzoCVmOk5hJ+RWVzu+wUVQ4tAn3Yrt7drit\nhnNfW4mIjVsT8R2i9XHYvYyTXaz2rtyN9x9TLIdecKgbhYj526b5ZVR3gC2d\nuZ4B4b/Cg3kdVgUt0tzOO8Isw81Kj/bYIrgwa7RqdUwZTcA11TeGBiKtVDye\nSBRYyUniD65y6aykhPxjKWsso5btbzuA0OU3TK0hT/HE+NkOq5VcupUPvPBM\nTOGjVMlQNhGqsJcmJ0UoW3CKvN6g3p1xKGtytRXhPcA4pRUKgTEGOTMxblwi\nkoEnQ4C19er4CfVBGUprXpwczPkZJ5VjhSSKOpT+YNib6vZUQCivAUHTV7eN\nNEaM1LFoKuX4wL9anYd+XtShyyVsql3vtdcHXDprh/02qQHzvELY+py04XpG\nHZcgdA3YT2Bb7jyZpDwwLr8kwmtSQZDYaS/PV+bqGHbdhuwjdbJS6AaDiks0\nq+iBL1OYv/NWK9bCHRmwQVL7tr9iyKax9LnlUIK8QWtcyFogHt3bgNWQeFYa\nJdMhgN0/FmRmPjOnTftDWHU8+TaSFfGXp796ZFPBv0h8mFJlGlVTa/otM76/\n+ijp\r\n=j8br\r\n-----END PGP SIGNATURE-----\r\n", - "shasum": "fe6b355a190926ab7698c9a0556a11199b2199bd", - "tarball": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "unpackedSize": 15532 + "integrity": "sha512-ROk/m+gMVSrRxTkMlaQOvFmFmYDc7sZgrjjM76abqmd2Cc5fCV7jAMA5XUccEtJ3cYiYdgixUVI+fApc2LkXlw==", + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJct//rCRA9TVsSAnZWagAADUcP/1Sx8SZMb+Y0DvqR26zd\nsX74VQgoI4cXQmf1hh/jo2EUpvSK1xxz9H2fQKeF+HPreIhbqretsWfqh4Sd\nsbKVqusZ8xWMz1+Y1whWFzpGMeAe/Fkatka+YgHOsxA9RVcxVVkLCg4PR7ve\n1OxGIUtI5Eqhb7/UTcNY2ha+GwA/RgVnrImoTwNAucLpcaR8KCwpMCd+36nH\n/Rwz6v634o9dHZhvbId/kwpYaoKp3FACuGnmaydheqfv3bm+lqTvLpCCekD6\nTnXI5YJdQWEZp23MVqHCEL3/vYvcck2drlkD8cMLm6Z/6gBGIgvXLqcVnmvQ\nMcJ/MxzGEpaf51594zBAIXcj492IVSw0WN6W+vf0cRyLCqMPGFtRkzJfx/FU\nkp7dkjkpqP41yRWO42dBfSuqRzfPhNr1UPyLjFN6ZSc/MrzijVQKFY0cNmOS\nc81ZSp2RymrE9rJbyZ3DQv9AW4uVy0Was+39+NqtQTMJ6vh7xp+9nUKtnWFy\nQiES2KNAmIOIe4nbNavnbJiFUVzxFqP+NdsKRThXafzYSWJ8URakA3k3u2SK\nHTRbCr18uu+I1ZzZySbvPpE+L6ZzsL3ozbndpei7sDl6QUuHukIjpqH6+M/2\nYmkOnvpDjvNQPbPvqBcZ4zRdpZ3Gqgbu1eZNkwSHyo+tkTaUkZqsw+VlTGwC\nvHXB\r\n=ccqn\r\n-----END PGP SIGNATURE-----\r\n", + "shasum": "d4eacd87de99348a6858fe1e479aad877388d977", + "tarball": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.23.tgz", + "unpackedSize": 15698 }, "engines": { "node": ">= 0.6" }, - "gitHead": "0ac5fe1ad9008b4b141e9f32fb4d63a6478669ba", + "gitHead": "28b73337cb1aa1583b72d448f30e2f49d6f5f07e", "homepage": "https://github.com/jshttp/mime-types#readme", "keywords": [ "mime", @@ -118,5 +118,5 @@ "test-cov": "nyc --reporter=html --reporter=text npm test", "test-travis": "nyc --reporter=text npm test" }, - "version": "2.1.22" + "version": "2.1.23" } diff --git a/node_modules/proxysocket/README.md b/node_modules/proxysocket/README.md index 63dcaa9..2af458e 100644 --- a/node_modules/proxysocket/README.md +++ b/node_modules/proxysocket/README.md @@ -30,7 +30,7 @@ Create a new socket that will use the proxy: The returned object behaves like an ordinary `net.Socket` object. For example, you can call `connect()` or listen for events: - socket.connect('website.com', 80, function () { + socket.connect(80, 'website.com', function () { // Connected }); @@ -40,7 +40,7 @@ For example, you can call `connect()` or listen for events: Also note if you're using Tor it's fine to pass `.onion` hosts: - socket.connect('p4fsi4ockecnea7l.onion', 6667); + socket.connect(6667, 'p4fsi4ockecnea7l.onion'); ### Making HTTP Requests @@ -58,6 +58,19 @@ like `http.Agent` which will make proxy sockets for you when using agent: agent }); +### Chaining + +It's fine to pass one proxysocket to another: +```js + var socket1 = proxysocket.create('socks1addr', 9050) + var socket2 = proxysocket.create('socks2addr', 9050, socket1) + + socket2.connect(80, 'example.com', function () { + // connected + }) +``` +The resulting chain: +socksaddr1:9050 -> socksaddr2:9050 -> example.com ## API @@ -67,7 +80,8 @@ Create a new socket object that uses a SOCKS5 proxy provided. * `socksHost` is the host of the proxy. Default is `localhost` * `socksPort` is the port of the proxy. Default is `9050` -* `socket` can be an existing `net.Socket` object. Default is a `new Socket()` +* `socket` can be an existing `net.Socket` object or any object with +the same interface (e.g. `proxysocket`). Default is a `new Socket()` ### proxysocket.createAgent(socksHost, socksPort) diff --git a/node_modules/proxysocket/package.json b/node_modules/proxysocket/package.json index f75384b..ee59ea9 100644 --- a/node_modules/proxysocket/package.json +++ b/node_modules/proxysocket/package.json @@ -1,41 +1,40 @@ { "_args": [ [ - "proxysocket", + "https://github.com/krisives/proxysocket", "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client" ] ], - "_from": "proxysocket@latest", + "_from": "git+https://github.com/krisives/proxysocket.git", "_id": "proxysocket@1.2.0", "_inCache": true, "_installable": true, "_location": "/proxysocket", - "_nodeVersion": "4.6.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/proxysocket-1.2.0.tgz_1477420117142_0.21117400820367038" - }, - "_npmUser": { - "email": "kristopher.ives@gmail.com", - "name": "krisives" - }, - "_npmVersion": "2.15.9", "_phantomChildren": {}, "_requested": { - "name": "proxysocket", - "raw": "proxysocket", - "rawSpec": "", + "hosted": { + "directUrl": "https://raw.githubusercontent.com/krisives/proxysocket/master/package.json", + "gitUrl": "git://github.com/krisives/proxysocket.git", + "httpsUrl": "git+https://github.com/krisives/proxysocket.git", + "shortcut": "github:krisives/proxysocket", + "ssh": "git@github.com:krisives/proxysocket.git", + "sshUrl": "git+ssh://git@github.com/krisives/proxysocket.git", + "type": "github" + }, + "name": null, + "raw": "https://github.com/krisives/proxysocket", + "rawSpec": "https://github.com/krisives/proxysocket", "scope": null, - "spec": "latest", - "type": "tag" + "spec": "git+https://github.com/krisives/proxysocket.git", + "type": "hosted" }, "_requiredBy": [ "#USER" ], - "_resolved": "https://registry.npmjs.org/proxysocket/-/proxysocket-1.2.0.tgz", - "_shasum": "0d654c36754a40421e7e65971d62fe1f1a6938b7", + "_resolved": "git+https://github.com/krisives/proxysocket.git#fad5cf6998e763a1e7b2c1c2beb12cbe6467dd3e", + "_shasum": "f0801e08b1811831c4308020ceb5b882f5648348", "_shrinkwrap": null, - "_spec": "proxysocket", + "_spec": "https://github.com/krisives/proxysocket", "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client", "author": { "email": "kristopher.ives@gmail.com", @@ -48,15 +47,10 @@ "dependencies": {}, "description": "SOCKS5 client for making socket connections", "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "0d654c36754a40421e7e65971d62fe1f1a6938b7", - "tarball": "https://registry.npmjs.org/proxysocket/-/proxysocket-1.2.0.tgz" - }, "engines": { "node": "0.x" }, - "gitHead": "156f6fa27313979126a9743ec0ec9cab21fc8915", + "gitHead": "fad5cf6998e763a1e7b2c1c2beb12cbe6467dd3e", "homepage": "https://github.com/krisives/proxysocket", "keywords": [ "proxy", @@ -73,19 +67,13 @@ } ], "main": "proxysocket.js", - "maintainers": [ - { - "name": "krisives", - "email": "kristopher.ives@gmail.com" - } - ], "name": "proxysocket", "optionalDependencies": {}, - "readme": "ERROR: No README data found!", + "readme": "# proxysocket\r\n\r\n[![Join the chat at https://gitter.im/krisives/proxysocket](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/krisives/proxysocket?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\r\n\r\n`proxysocket` is a nodejs module for seamlessly making socket connections via a\r\nSOCKS5 proxy. Use it in place of a regular `net.Socket` to easily talk over\r\nTor or an SSH tunnel.\r\n\r\n## Install\r\n\r\nAvailable on npm for easy install:\r\n\r\n\tnpm install proxysocket\r\n\r\nYou can also download a [release](https://github.com/krisives/proxysocket/releases) manually and\r\nextract it as `proxysocket` has no dependencies.\r\n\r\n## Usage\r\n\r\nBecause `proxysocket` provides the same API as a regular `net.Socket` object\r\nyou can use it in many places where sockets and streams are used.\r\n\r\n### Making a Socket\r\n\r\nCreate a new socket that will use the proxy:\r\n\r\n\tvar proxysocket = require('proxysocket');\r\n\tvar socket = proxysocket.create('localhost', 9050);\r\n\r\nThe returned object behaves like an ordinary `net.Socket` object.\r\nFor example, you can call `connect()` or listen for events:\r\n\r\n\tsocket.connect(80, 'website.com', function () {\r\n\t\t// Connected\r\n\t});\r\n\r\n\tsocket.on('data', function (data) {\r\n\t\t// Receive data\r\n\t});\r\n\r\nAlso note if you're using Tor it's fine to pass `.onion` hosts:\r\n\r\n\tsocket.connect(6667, 'p4fsi4ockecnea7l.onion');\r\n\r\n\r\n### Making HTTP Requests\r\n\r\nYou can use `proxysocket.createAgent()` to create an object\r\nlike `http.Agent` which will make proxy sockets for you when using\r\n`http.request()`. Here is an example:\r\n\r\n\tvar proxysocket = require('proxysocket');\r\n\tvar http = require('http');\r\n\tvar agent = proxysocket.createAgent();\r\n\r\n\thttp.request({\r\n\t\thost: 'foo.com',\r\n\t\tagent: agent\r\n\t});\r\n\r\n### Chaining\r\n\r\nIt's fine to pass one proxysocket to another:\r\n```js\r\n\tvar socket1 = proxysocket.create('socks1addr', 9050)\r\n\tvar socket2 = proxysocket.create('socks2addr', 9050, socket1)\r\n\r\n\tsocket2.connect(80, 'example.com', function () {\r\n\t\t// connected\r\n\t})\r\n```\r\nThe resulting chain:\r\nsocksaddr1:9050 -> socksaddr2:9050 -> example.com\r\n\r\n## API\r\n\r\n### proxysocket.create(socksHost, socksPort, socket)\r\n\r\nCreate a new socket object that uses a SOCKS5 proxy provided.\r\n\r\n* `socksHost` is the host of the proxy. Default is `localhost`\r\n* `socksPort` is the port of the proxy. Default is `9050`\r\n* `socket` can be an existing `net.Socket` object or any object with\r\nthe same interface (e.g. `proxysocket`). Default is a `new Socket()`\r\n\r\n### proxysocket.createAgent(socksHost, socksPort)\r\n\r\nReturns an object like `http.Agent` which makes new sockets\r\nusing `proxysocket.create()` as needed.\r\n\r\n### socket\r\n\r\nThe object returned from `proxysocket.create()` is just like a regular\r\n`net.Socket`. This documentation lists additions to the API.\r\n\r\n*Note This documentation doesn't list all of the methods, properties,\r\nor events of `net.Socket`, `Readable` or `Writable`. See the nodejs\r\nAPI reference for those modules.*\r\n\r\n### socket.socksHost\r\n\r\nGet the host address of the proxy. By default this will be `localhost`.\r\n\r\n### socket.socksPort\r\n\r\nGet the port of the proxy. By default this will be `9050`.\r\n\r\n### socket.realSocket\r\n\r\nGet the underlying raw `net.Socket` connection to the proxy. You don't need\r\nto use this and instead should listen on `this` socket instead.\r\n\r\n### socket 'socksdata' event\r\n\r\n`socksdata` is emitted whenever underlying data is received from the proxy\r\nbefore the socket is ready for use. This is mainly here for debugging and you\r\nshould use the `data` event instead.\r\n\r\n## Contributing\r\n\r\nPlease fork and make a pull request if you have anything cool to add. You're\r\nalso welcome to join the [Gitter](https://gitter.im/krisives/proxysocket?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) chat.\r\n", + "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/krisives/proxysocket.git" }, - "scripts": {}, "version": "1.2.0" } diff --git a/node_modules/proxysocket/proxysocket.js b/node_modules/proxysocket/proxysocket.js index 176ef82..940914a 100644 --- a/node_modules/proxysocket/proxysocket.js +++ b/node_modules/proxysocket/proxysocket.js @@ -323,7 +323,16 @@ function proxysocket(socksHost, socksPort, socket) { return socket.setNoDelay(noDelay); }; - self.connect = function (connectHost, connectPort, f) { + self.connect = function (connectPort, connectHost, f) { + var tmp; + + // Backward compatibility + if (typeof(connectHost) === 'number' || isNaN(connectPort)) { + tmp = connectHost; + connectHost = connectPort; + connectPort = tmp; + } + if (connected) { throw new Error("Socket is already connected"); } @@ -343,7 +352,7 @@ function proxysocket(socksHost, socksPort, socket) { setEncoding(null); - socket.connect(socksPort, socksHost, function () { + return socket.connect(socksPort, socksHost, function () { connecting = false; sendAuth(); }); @@ -421,7 +430,7 @@ proxysocket.createAgent = function (socksHost, socksPort) { function connect(host, port, f) { var socket = proxysocket.create(socksHost, socksPort); - socket.connect(host, port, f); + socket.connect(port, host, f); return socket; } diff --git a/node_modules/semver/CHANGELOG.md b/node_modules/semver/CHANGELOG.md new file mode 100644 index 0000000..66304fd --- /dev/null +++ b/node_modules/semver/CHANGELOG.md @@ -0,0 +1,39 @@ +# changes log + +## 5.7 + +* Add `minVersion` method + +## 5.6 + +* Move boolean `loose` param to an options object, with + backwards-compatibility protection. +* Add ability to opt out of special prerelease version handling with + the `includePrerelease` option flag. + +## 5.5 + +* Add version coercion capabilities + +## 5.4 + +* Add intersection checking + +## 5.3 + +* Add `minSatisfying` method + +## 5.2 + +* Add `prerelease(v)` that returns prerelease components + +## 5.1 + +* Add Backus-Naur for ranges +* Remove excessively cute inspection methods + +## 5.0 + +* Remove AMD/Browserified build artifacts +* Fix ltr and gtr when using the `*` range +* Fix for range `*` with a prerelease identifier diff --git a/node_modules/semver/README.md b/node_modules/semver/README.md index e0edbb7..e5ccece 100644 --- a/node_modules/semver/README.md +++ b/node_modules/semver/README.md @@ -20,6 +20,7 @@ semver.clean(' =v1.2.3 ') // '1.2.3' semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true semver.gt('1.2.3', '9.8.7') // false semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' semver.valid(semver.coerce('v2')) // '2.0.0' semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' ``` @@ -29,7 +30,7 @@ As a command-line utility: ``` $ semver -h -A JavaScript implementation of the http://semver.org/ specification +A JavaScript implementation of the https://semver.org/ specification Copyright Isaac Z. Schlueter Usage: semver [options] [ [...]] @@ -71,7 +72,7 @@ multiple versions to the utility will just sort them. ## Versions A "version" is described by the `v2.0.0` specification found at -. +. A leading `"="` or `"v"` character is stripped off and ignored. @@ -137,6 +138,13 @@ the user is indicating that they are aware of the risk. However, it is still not appropriate to assume that they have opted into taking a similar risk on the *next* set of prerelease versions. +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + #### Prerelease Identifiers The method `.inc` takes an additional `identifier` string argument that @@ -325,6 +333,8 @@ strings that they parse. * `patch(v)`: Return the patch version number. * `intersects(r1, r2, loose)`: Return true if the two supplied ranges or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. ### Comparison @@ -361,6 +371,8 @@ strings that they parse. that satisfies the range, or `null` if none of them do. * `minSatisfying(versions, range)`: Return the lowest version in the list that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the diff --git a/node_modules/semver/bin/semver b/node_modules/semver/bin/semver index 9100ed4..801e77f 100644 --- a/node_modules/semver/bin/semver +++ b/node_modules/semver/bin/semver @@ -4,20 +4,28 @@ // any supplied version is valid and passes all tests. var argv = process.argv.slice(2) - , versions = [] - , range = [] - , gt = [] - , lt = [] - , eq = [] - , inc = null - , version = require("../package.json").version - , loose = false - , includePrerelease = false - , coerce = false - , identifier = undefined - , semver = require("../semver") - , reverse = false - , options = {} + +var versions = [] + +var range = [] + +var inc = null + +var version = require('../package.json').version + +var loose = false + +var includePrerelease = false + +var coerce = false + +var identifier + +var semver = require('../semver') + +var reverse = false + +var options = {} main() @@ -25,45 +33,45 @@ function main () { if (!argv.length) return help() while (argv.length) { var a = argv.shift() - var i = a.indexOf('=') - if (i !== -1) { - a = a.slice(0, i) - argv.unshift(a.slice(i + 1)) + var indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + a = a.slice(0, indexOfEqualSign) + argv.unshift(a.slice(indexOfEqualSign + 1)) } switch (a) { - case "-rv": case "-rev": case "--rev": case "--reverse": + case '-rv': case '-rev': case '--rev': case '--reverse': reverse = true break - case "-l": case "--loose": + case '-l': case '--loose': loose = true break - case "-p": case "--include-prerelease": + case '-p': case '--include-prerelease': includePrerelease = true break - case "-v": case "--version": + case '-v': case '--version': versions.push(argv.shift()) break - case "-i": case "--inc": case "--increment": + case '-i': case '--inc': case '--increment': switch (argv[0]) { - case "major": case "minor": case "patch": case "prerelease": - case "premajor": case "preminor": case "prepatch": + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': inc = argv.shift() break default: - inc = "patch" + inc = 'patch' break } break - case "--preid": + case '--preid': identifier = argv.shift() break - case "-r": case "--range": + case '-r': case '--range': range.push(argv.shift()) break - case "-c": case "--coerce": + case '-c': case '--coerce': coerce = true break - case "-h": case "--help": case "-?": + case '-h': case '--help': case '-?': return help() default: versions.push(a) @@ -74,15 +82,14 @@ function main () { var options = { loose: loose, includePrerelease: includePrerelease } versions = versions.map(function (v) { - return coerce ? (semver.coerce(v) || {version: v}).version : v + return coerce ? (semver.coerce(v) || { version: v }).version : v }).filter(function (v) { return semver.valid(v) }) if (!versions.length) return fail() - if (inc && (versions.length !== 1 || range.length)) - return failInc() + if (inc && (versions.length !== 1 || range.length)) { return failInc() } - for (var i = 0, l = range.length; i < l ; i ++) { + for (var i = 0, l = range.length; i < l; i++) { versions = versions.filter(function (v) { return semver.satisfies(v, range[i], options) }) @@ -92,62 +99,62 @@ function main () { } function failInc () { - console.error("--inc can only be used on a single version with no range") + console.error('--inc can only be used on a single version with no range') fail() } function fail () { process.exit(1) } function success () { - var compare = reverse ? "rcompare" : "compare" + var compare = reverse ? 'rcompare' : 'compare' versions.sort(function (a, b) { return semver[compare](a, b, options) }).map(function (v) { return semver.clean(v, options) }).map(function (v) { return inc ? semver.inc(v, inc, options, identifier) : v - }).forEach(function (v,i,_) { console.log(v) }) + }).forEach(function (v, i, _) { console.log(v) }) } function help () { - console.log(["SemVer " + version - ,"" - ,"A JavaScript implementation of the http://semver.org/ specification" - ,"Copyright Isaac Z. Schlueter" - ,"" - ,"Usage: semver [options] [ [...]]" - ,"Prints valid versions sorted by SemVer precedence" - ,"" - ,"Options:" - ,"-r --range " - ," Print versions that match the specified range." - ,"" - ,"-i --increment []" - ," Increment a version by the specified level. Level can" - ," be one of: major, minor, patch, premajor, preminor," - ," prepatch, or prerelease. Default level is 'patch'." - ," Only one version may be specified." - ,"" - ,"--preid " - ," Identifier to be used to prefix premajor, preminor," - ," prepatch or prerelease version increments." - ,"" - ,"-l --loose" - ," Interpret versions and ranges loosely" - ,"" - ,"-p --include-prerelease" - ," Always include prerelease versions in range matching" - ,"" - ,"-c --coerce" - ," Coerce a string into SemVer if possible" - ," (does not imply --loose)" - ,"" - ,"Program exits successfully if any valid version satisfies" - ,"all supplied ranges, and prints all satisfying versions." - ,"" - ,"If no satisfying versions are found, then exits failure." - ,"" - ,"Versions are printed in ascending order, so supplying" - ,"multiple versions to the utility will just sort them." - ].join("\n")) + console.log(['SemVer ' + version, + '', + 'A JavaScript implementation of the https://semver.org/ specification', + 'Copyright Isaac Z. Schlueter', + '', + 'Usage: semver [options] [ [...]]', + 'Prints valid versions sorted by SemVer precedence', + '', + 'Options:', + '-r --range ', + ' Print versions that match the specified range.', + '', + '-i --increment []', + ' Increment a version by the specified level. Level can', + ' be one of: major, minor, patch, premajor, preminor,', + " prepatch, or prerelease. Default level is 'patch'.", + ' Only one version may be specified.', + '', + '--preid ', + ' Identifier to be used to prefix premajor, preminor,', + ' prepatch or prerelease version increments.', + '', + '-l --loose', + ' Interpret versions and ranges loosely', + '', + '-p --include-prerelease', + ' Always include prerelease versions in range matching', + '', + '-c --coerce', + ' Coerce a string into SemVer if possible', + ' (does not imply --loose)', + '', + 'Program exits successfully if any valid version satisfies', + 'all supplied ranges, and prints all satisfying versions.', + '', + 'If no satisfying versions are found, then exits failure.', + '', + 'Versions are printed in ascending order, so supplying', + 'multiple versions to the utility will just sort them.' + ].join('\n')) } diff --git a/node_modules/semver/package.json b/node_modules/semver/package.json index 5179799..0bb46b9 100644 --- a/node_modules/semver/package.json +++ b/node_modules/semver/package.json @@ -7,20 +7,20 @@ ], "_from": "semver@>=5.4.1 <6.0.0", "_hasShrinkwrap": false, - "_id": "semver@5.6.0", + "_id": "semver@5.7.0", "_inCache": true, "_installable": true, "_location": "/semver", - "_nodeVersion": "10.10.0", + "_nodeVersion": "11.11.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/semver_5.6.0_1539215545199_0.6768223257800898" + "tmp": "tmp/semver_5.7.0_1553642746999_0.7735603320650997" }, "_npmUser": { "email": "i@izs.me", "name": "isaacs" }, - "_npmVersion": "6.4.1", + "_npmVersion": "6.9.0", "_phantomChildren": {}, "_requested": { "name": "semver", @@ -34,8 +34,8 @@ "/electron-download", "/normalize-package-data" ], - "_resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "_shasum": "7e74256fbaa49c75aa7c7a205cc22799cac80004", + "_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "_shasum": "790a7cf6fea5459bac96110b29b60412dc8ff96b", "_shrinkwrap": null, "_spec": "semver@^5.4.1", "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client/node_modules/electron-download", @@ -48,18 +48,18 @@ "dependencies": {}, "description": "The semantic version parser used by npm.", "devDependencies": { - "tap": "^12.0.1" + "tap": "^13.0.0-rc.18" }, "directories": {}, "dist": { - "fileCount": 6, - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvpC6CRA9TVsSAnZWagAApbMP/3bk+fOFL1FLwS924EDm\nrwE9nR9Knp9+J6Gme1UH1HvMkNm92/ZSvrbMaW5Uzw3RhRJOEjdtDpQFpJ/N\n7SFdFf4RmrZKThr4EuVVi/Iuy2MwIpZ3UUbrDYWV1kTwfMeW6mDWqcNUOOIk\nHLW9icN0oyvbB4LfPwhr3SFDKlTi6TlyZseQHFGndSbw2/mS9wdLHaa6bz0x\nB85SW5PVPw7Y83RdzdPz59vrNmVytY0pEsepLR7IQkdyB+YU7cIxR7gLbzkY\nUV5F6FyvvOcrfEIiRZgprhH5a2RnYZ8Id/3/ca08yN1Q65SsjztKq4Bh7+JI\nO/pjNjRWKLYsRom9l4q4iAFhdy6fFHlqkUkM1Yy5jFmQNjSk5RnpuRrDUUXV\ntFbWGkEccYrXby5WOq1JZxJ/MfiUpxg22qlO3AcTHbKddhFZvYh/cQFIohV4\nbmV7TeWoodJ7KaF6MVhnwda1AWTBZTNSqrCmsmDSZZwNb6NQhVSrbkLXDbgu\ntN4RhRPjOE1mFYjuGJuN32oSdceOCT9x61Lr0uucw8JHZldVIe0o63Qb6/4t\ntl+wzR3JfbdkB1vGVo8oXm8KoghMhFwmpD+RKg4hPxJhxQTXRy4OUsSkU5+l\nRRK9JHTyBGXbpcyeVLtPAGYdsl42sYG9+lSqGI3at/HKDcJrnzp3KJ4fXcUB\nlkPD\r\n=LpzA\r\n-----END PGP SIGNATURE-----\r\n", - "shasum": "7e74256fbaa49c75aa7c7a205cc22799cac80004", - "tarball": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "unpackedSize": 59721 + "fileCount": 7, + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcmrT8CRA9TVsSAnZWagAARMMQAI415wi9qxabS351a5Wf\nFD71A8Ss13BZZJ/R1R6kGsSrGbM9d0cjrikxGnVc0nTyyG9cu4MZRQTQiAPn\norBKEUk7xtYzXXAseaQAJX3g1/iX+aGkZBEo14yABXfv615Xnmroe5yQ3m6h\n0HkHxXjdxRwBb2WEwNDCNrvmzTwxvkGg32Rqu+Ow+fbsnubgc7+q12ooq9lD\nscxvAqhMuDcHRFHEFoQFUpW5YO+N7/cY7GEdNkJnsDbd+yCfnJOJSUqDF0rz\nHiv+j9CkwiRMkliimBW1KXRiYz2S/HjEuOcfg+MwUk7l3pFIZH2cTyYoQBQC\n+nR241WcuWBX+BwOFmbvHiMWPcJGvYK8r9Ql7Pswzjxerbt/VIOiWAEFlVX1\nOaopM8d+exP8EEurYBFT1OF0FSD5LOjV96b7B3SuvlrooDVU4lKdF+wXWsPr\nkHR01hULTV/JG4BTvblo5T7x74lJ8tG5vIW/CQQXLDeAgVlHgJNdrmnX+nB4\nwBcWDw/bZYJ1AV3Zzb3VJKbSjw4GAgo8OevlGrAmyp8T7IhZzpX+V/BQs1V1\nW7AiEVUmptY89GWCBc5MPc+YwEeg+ti0LfLGcn15+CFFImIY1taytkuGpCMw\nA2+lsjXrW9+7RtUInZFjbFxsh/q1HRFng+C8dRhBBpPOmbHGRBUUtClHU9V4\nkbZh\r\n=hoZW\r\n-----END PGP SIGNATURE-----\r\n", + "shasum": "790a7cf6fea5459bac96110b29b60412dc8ff96b", + "tarball": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "unpackedSize": 61574 }, - "gitHead": "46727afbe21b8d14641a0d1c4c7ee58bd053f922", + "gitHead": "8055dda0aee91372e3bfc47754a62f40e8a63b98", "homepage": "https://github.com/npm/node-semver#readme", "license": "ISC", "main": "semver.js", @@ -81,7 +81,13 @@ "url": "git+https://github.com/npm/node-semver.git" }, "scripts": { - "test": "tap test/*.js --cov -J" + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap" }, - "version": "5.6.0" + "tap": { + "check-coverage": true + }, + "version": "5.7.0" } diff --git a/node_modules/semver/semver.js b/node_modules/semver/semver.js index 0cc5735..d315d5d 100644 --- a/node_modules/semver/semver.js +++ b/node_modules/semver/semver.js @@ -1,33 +1,35 @@ -exports = module.exports = SemVer; +exports = module.exports = SemVer -// The debug function is excluded entirely from the minified version. -/* nomin */ var debug; -/* nomin */ if (typeof process === 'object' && - /* nomin */ process.env && - /* nomin */ process.env.NODE_DEBUG && - /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) - /* nomin */ debug = function() { - /* nomin */ var args = Array.prototype.slice.call(arguments, 0); - /* nomin */ args.unshift('SEMVER'); - /* nomin */ console.log.apply(console, args); - /* nomin */ }; -/* nomin */ else - /* nomin */ debug = function() {}; +var debug +/* istanbul ignore next */ +if (typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug = function () { + var args = Array.prototype.slice.call(arguments, 0) + args.unshift('SEMVER') + console.log.apply(console, args) + } +} else { + debug = function () {} +} // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; +exports.SEMVER_SPEC_VERSION = '2.0.0' -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; +var MAX_LENGTH = 256 +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || + /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. -var MAX_SAFE_COMPONENT_LENGTH = 16; +var MAX_SAFE_COMPONENT_LENGTH = 16 // The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; +var re = exports.re = [] +var src = exports.src = [] +var R = 0 // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. @@ -35,71 +37,67 @@ var R = 0; // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - +var NUMERICIDENTIFIER = R++ +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' +var NUMERICIDENTIFIERLOOSE = R++ +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - +var NONNUMERICIDENTIFIER = R++ +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' // ## Main Version // Three dot-separated numeric identifiers. -var MAINVERSION = R++; +var MAINVERSION = R++ src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; + '(' + src[NUMERICIDENTIFIER] + ')' -var MAINVERSIONLOOSE = R++; +var MAINVERSIONLOOSE = R++ src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + '(' + src[NUMERICIDENTIFIERLOOSE] + ')' // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. -var PRERELEASEIDENTIFIER = R++; +var PRERELEASEIDENTIFIER = R++ src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; + '|' + src[NONNUMERICIDENTIFIER] + ')' -var PRERELEASEIDENTIFIERLOOSE = R++; +var PRERELEASEIDENTIFIERLOOSE = R++ src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - + '|' + src[NONNUMERICIDENTIFIER] + ')' // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. -var PRERELEASE = R++; +var PRERELEASE = R++ src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' -var PRERELEASELOOSE = R++; +var PRERELEASELOOSE = R++ src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; +var BUILDIDENTIFIER = R++ +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. -var BUILD = R++; +var BUILD = R++ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' // ## Full Version String // A main version, followed optionally by a pre-release version and @@ -110,802 +108,870 @@ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + // capturing group, because it should not ever be used in version // comparison. -var FULL = R++; +var FULL = R++ var FULLPLAIN = 'v?' + src[MAINVERSION] + src[PRERELEASE] + '?' + - src[BUILD] + '?'; + src[BUILD] + '?' -src[FULL] = '^' + FULLPLAIN + '$'; +src[FULL] = '^' + FULLPLAIN + '$' // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; + src[BUILD] + '?' -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; +var LOOSE = R++ +src[LOOSE] = '^' + LOOSEPLAIN + '$' -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; +var GTLT = R++ +src[GTLT] = '((?:<|>)?=?)' // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; +var XRANGEIDENTIFIERLOOSE = R++ +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' +var XRANGEIDENTIFIER = R++ +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' -var XRANGEPLAIN = R++; +var XRANGEPLAIN = R++ src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:' + src[PRERELEASE] + ')?' + src[BUILD] + '?' + - ')?)?'; + ')?)?' -var XRANGEPLAINLOOSE = R++; +var XRANGEPLAINLOOSE = R++ src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[PRERELEASELOOSE] + ')?' + src[BUILD] + '?' + - ')?)?'; + ')?)?' -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; +var XRANGE = R++ +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' +var XRANGELOOSE = R++ +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' // Coercion. // Extract anything that could conceivably be a part of a valid semver -var COERCE = R++; +var COERCE = R++ src[COERCE] = '(?:^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + - '(?:$|[^\\d])'; + '(?:$|[^\\d])' // Tilde ranges. // Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; +var LONETILDE = R++ +src[LONETILDE] = '(?:~>?)' -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; +var TILDETRIM = R++ +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') +var tildeTrimReplace = '$1~' -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; +var TILDE = R++ +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' +var TILDELOOSE = R++ +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' // Caret ranges. // Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; +var LONECARET = R++ +src[LONECARET] = '(?:\\^)' -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; +var CARETTRIM = R++ +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') +var caretTrimReplace = '$1^' -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; +var CARET = R++ +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' +var CARETLOOSE = R++ +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' // A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - +var COMPARATORLOOSE = R++ +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' +var COMPARATOR = R++ +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; +var COMPARATORTRIM = R++ src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' // this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') +var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. -var HYPHENRANGE = R++; +var HYPHENRANGE = R++ src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; + '\\s*$' -var HYPHENRANGELOOSE = R++; +var HYPHENRANGELOOSE = R++ src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; + '\\s*$' // Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; +var STAR = R++ +src[STAR] = '(<|>)?=?\\s*\\*' // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { - debug(i, src[i]); - if (!re[i]) - re[i] = new RegExp(src[i]); + debug(i, src[i]) + if (!re[i]) { + re[i] = new RegExp(src[i]) + } } -exports.parse = parse; -function parse(version, options) { - if (!options || typeof options !== 'object') - options = { loose: !!options, includePrerelease: false } +exports.parse = parse +function parse (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } - if (version instanceof SemVer) - return version; + if (version instanceof SemVer) { + return version + } - if (typeof version !== 'string') - return null; + if (typeof version !== 'string') { + return null + } - if (version.length > MAX_LENGTH) - return null; + if (version.length > MAX_LENGTH) { + return null + } - var r = options.loose ? re[LOOSE] : re[FULL]; - if (!r.test(version)) - return null; + var r = options.loose ? re[LOOSE] : re[FULL] + if (!r.test(version)) { + return null + } try { - return new SemVer(version, options); + return new SemVer(version, options) } catch (er) { - return null; + return null } } -exports.valid = valid; -function valid(version, options) { - var v = parse(version, options); - return v ? v.version : null; +exports.valid = valid +function valid (version, options) { + var v = parse(version, options) + return v ? v.version : null } - -exports.clean = clean; -function clean(version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ''), options); - return s ? s.version : null; +exports.clean = clean +function clean (version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null } -exports.SemVer = SemVer; +exports.SemVer = SemVer -function SemVer(version, options) { - if (!options || typeof options !== 'object') - options = { loose: !!options, includePrerelease: false } +function SemVer (version, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } if (version instanceof SemVer) { - if (version.loose === options.loose) - return version; - else - version = version.version; + if (version.loose === options.loose) { + return version + } else { + version = version.version + } } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); + throw new TypeError('Invalid Version: ' + version) } - if (version.length > MAX_LENGTH) + if (version.length > MAX_LENGTH) { throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + } - if (!(this instanceof SemVer)) - return new SemVer(version, options); + if (!(this instanceof SemVer)) { + return new SemVer(version, options) + } - debug('SemVer', version, options); - this.options = options; - this.loose = !!options.loose; + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose - var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]); + var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) - if (!m) - throw new TypeError('Invalid Version: ' + version); + if (!m) { + throw new TypeError('Invalid Version: ' + version) + } - this.raw = version; + this.raw = version // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] - if (this.major > MAX_SAFE_INTEGER || this.major < 0) + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') + } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') + } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') + } // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map(function (id) { if (/^[0-9]+$/.test(id)) { - var num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) - return num; + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } } - return id; - }); + return id + }) + } - this.build = m[5] ? m[5].split('.') : []; - this.format(); + this.build = m[5] ? m[5].split('.') : [] + this.format() } -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; +SemVer.prototype.format = function () { + this.version = this.major + '.' + this.minor + '.' + this.patch + if (this.prerelease.length) { + this.version += '-' + this.prerelease.join('.') + } + return this.version +} -SemVer.prototype.toString = function() { - return this.version; -}; +SemVer.prototype.toString = function () { + return this.version +} -SemVer.prototype.compare = function(other) { - debug('SemVer.compare', this.version, this.options, other); - if (!(other instanceof SemVer)) - other = new SemVer(other, this.options); +SemVer.prototype.compare = function (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } - return this.compareMain(other) || this.comparePre(other); -}; + return this.compareMain(other) || this.comparePre(other) +} -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.options); +SemVer.prototype.compareMain = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; + compareIdentifiers(this.patch, other.patch) +} -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.options); +SemVer.prototype.comparePre = function (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.length && !other.prerelease.length) - return 0; + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } - var i = 0; + var i = 0 do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; + var a = this.prerelease[i] + var b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) +} // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function(release, identifier) { +SemVer.prototype.inc = function (release, identifier) { switch (release) { case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier) + break case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier) + break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; + this.prerelease.length = 0 + this.inc('patch', identifier) + this.inc('pre', identifier) + break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': - if (this.prerelease.length === 0) - this.inc('patch', identifier); - this.inc('pre', identifier); - break; + if (this.prerelease.length === 0) { + this.inc('patch', identifier) + } + this.inc('pre', identifier) + break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) - this.major++; - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; + if (this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) - this.minor++; - this.patch = 0; - this.prerelease = []; - break; + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) - this.patch++; - this.prerelease = []; - break; + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; + if (this.prerelease.length === 0) { + this.prerelease = [0] + } else { + var i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; + this.prerelease[i]++ + i = -2 } } - if (i === -1) // didn't increment anything - this.prerelease.push(0); + if (i === -1) { + // didn't increment anything + this.prerelease.push(0) + } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) - this.prerelease = [identifier, 0]; - } else - this.prerelease = [identifier, 0]; + if (isNaN(this.prerelease[1])) { + this.prerelease = [identifier, 0] + } + } else { + this.prerelease = [identifier, 0] + } } - break; + break default: - throw new Error('invalid increment argument: ' + release); + throw new Error('invalid increment argument: ' + release) } - this.format(); - this.raw = this.version; - return this; -}; + this.format() + this.raw = this.version + return this +} -exports.inc = inc; -function inc(version, release, loose, identifier) { - if (typeof(loose) === 'string') { - identifier = loose; - loose = undefined; +exports.inc = inc +function inc (version, release, loose, identifier) { + if (typeof (loose) === 'string') { + identifier = loose + loose = undefined } try { - return new SemVer(version, loose).inc(release, identifier).version; + return new SemVer(version, loose).inc(release, identifier).version } catch (er) { - return null; + return null } } -exports.diff = diff; -function diff(version1, version2) { +exports.diff = diff +function diff (version1, version2) { if (eq(version1, version2)) { - return null; + return null } else { - var v1 = parse(version1); - var v2 = parse(version2); + var v1 = parse(version1) + var v2 = parse(version2) + var prefix = '' if (v1.prerelease.length || v2.prerelease.length) { - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return 'pre'+key; - } - } - } - return 'prerelease'; + prefix = 'pre' + var defaultResult = 'prerelease' } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { - return key; + return prefix + key } } } + return defaultResult // may be undefined } } -exports.compareIdentifiers = compareIdentifiers; +exports.compareIdentifiers = compareIdentifiers -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); +var numeric = /^[0-9]+$/ +function compareIdentifiers (a, b) { + var anum = numeric.test(a) + var bnum = numeric.test(b) if (anum && bnum) { - a = +a; - b = +b; + a = +a + b = +b } - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 } -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); +exports.rcompareIdentifiers = rcompareIdentifiers +function rcompareIdentifiers (a, b) { + return compareIdentifiers(b, a) } -exports.major = major; -function major(a, loose) { - return new SemVer(a, loose).major; +exports.major = major +function major (a, loose) { + return new SemVer(a, loose).major } -exports.minor = minor; -function minor(a, loose) { - return new SemVer(a, loose).minor; +exports.minor = minor +function minor (a, loose) { + return new SemVer(a, loose).minor } -exports.patch = patch; -function patch(a, loose) { - return new SemVer(a, loose).patch; +exports.patch = patch +function patch (a, loose) { + return new SemVer(a, loose).patch } -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); +exports.compare = compare +function compare (a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)) } -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); +exports.compareLoose = compareLoose +function compareLoose (a, b) { + return compare(a, b, true) } -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); +exports.rcompare = rcompare +function rcompare (a, b, loose) { + return compare(b, a, loose) } -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); +exports.sort = sort +function sort (list, loose) { + return list.sort(function (a, b) { + return exports.compare(a, b, loose) + }) } -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); +exports.rsort = rsort +function rsort (list, loose) { + return list.sort(function (a, b) { + return exports.rcompare(a, b, loose) + }) } -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; +exports.gt = gt +function gt (a, b, loose) { + return compare(a, b, loose) > 0 } -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; +exports.lt = lt +function lt (a, b, loose) { + return compare(a, b, loose) < 0 } -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; +exports.eq = eq +function eq (a, b, loose) { + return compare(a, b, loose) === 0 } -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; +exports.neq = neq +function neq (a, b, loose) { + return compare(a, b, loose) !== 0 } -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; +exports.gte = gte +function gte (a, b, loose) { + return compare(a, b, loose) >= 0 } -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; +exports.lte = lte +function lte (a, b, loose) { + return compare(a, b, loose) <= 0 } -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; +exports.cmp = cmp +function cmp (a, op, b, loose) { switch (op) { case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a === b; - break; + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a === b + case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a !== b; - break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); + if (typeof a === 'object') + a = a.version + if (typeof b === 'object') + b = b.version + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError('Invalid operator: ' + op) } - return ret; } -exports.Comparator = Comparator; -function Comparator(comp, options) { - if (!options || typeof options !== 'object') - options = { loose: !!options, includePrerelease: false } +exports.Comparator = Comparator +function Comparator (comp, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) - return comp; - else - comp = comp.value; + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } } - if (!(this instanceof Comparator)) - return new Comparator(comp, options); + if (!(this instanceof Comparator)) { + return new Comparator(comp, options) + } - debug('comparator', comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } - debug('comp', this); + debug('comp', this) } -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); +var ANY = {} +Comparator.prototype.parse = function (comp) { + var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var m = comp.match(r) - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - if (this.operator === '=') - this.operator = ''; - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else - this.semver = new SemVer(m[2], this.options.loose); -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - debug('Comparator.test', version, this.options.loose); - - if (this.semver === ANY) - return true; - - if (typeof version === 'string') - version = new SemVer(version, this.options); - - return cmp(version, this.operator, this.semver, this.options); -}; - -Comparator.prototype.intersects = function(comp, options) { - if (!(comp instanceof Comparator)) { - throw new TypeError('a Comparator is required'); + if (!m) { + throw new TypeError('Invalid comparator: ' + comp) } - if (!options || typeof options !== 'object') - options = { loose: !!options, includePrerelease: false } + this.operator = m[1] + if (this.operator === '=') { + this.operator = '' + } - var rangeTmp; + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } +} + +Comparator.prototype.toString = function () { + return this.value +} + +Comparator.prototype.test = function (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY) { + return true + } + + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } + + return cmp(version, this.operator, this.semver, this.options) +} + +Comparator.prototype.intersects = function (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } + + var rangeTmp if (this.operator === '') { - rangeTmp = new Range(comp.value, options); - return satisfies(this.value, rangeTmp, options); + rangeTmp = new Range(comp.value, options) + return satisfies(this.value, rangeTmp, options) } else if (comp.operator === '') { - rangeTmp = new Range(this.value, options); - return satisfies(comp.semver, rangeTmp, options); + rangeTmp = new Range(this.value, options) + return satisfies(comp.semver, rangeTmp, options) } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && - (comp.operator === '>=' || comp.operator === '>'); + (comp.operator === '>=' || comp.operator === '>') var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && - (comp.operator === '<=' || comp.operator === '<'); - var sameSemVer = this.semver.version === comp.semver.version; + (comp.operator === '<=' || comp.operator === '<') + var sameSemVer = this.semver.version === comp.semver.version var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && - (comp.operator === '>=' || comp.operator === '<='); + (comp.operator === '>=' || comp.operator === '<=') var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && ((this.operator === '>=' || this.operator === '>') && - (comp.operator === '<=' || comp.operator === '<')); + (comp.operator === '<=' || comp.operator === '<')) var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && ((this.operator === '<=' || this.operator === '<') && - (comp.operator === '>=' || comp.operator === '>')); + (comp.operator === '>=' || comp.operator === '>')) return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || - oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; -}; + oppositeDirectionsLessThan || oppositeDirectionsGreaterThan +} - -exports.Range = Range; -function Range(range, options) { - if (!options || typeof options !== 'object') - options = { loose: !!options, includePrerelease: false } +exports.Range = Range +function Range (range, options) { + if (!options || typeof options !== 'object') { + options = { + loose: !!options, + includePrerelease: false + } + } if (range instanceof Range) { if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; + return range } else { - return new Range(range.raw, options); + return new Range(range.raw, options) } } if (range instanceof Comparator) { - return new Range(range.value, options); + return new Range(range.value, options) } - if (!(this instanceof Range)) - return new Range(range, options); + if (!(this instanceof Range)) { + return new Range(range, options) + } - this.options = options; - this.loose = !!options.loose; + this.options = options + this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { + this.raw = range + this.set = range.split(/\s*\|\|\s*/).map(function (range) { + return this.parseRange(range.trim()) + }, this).filter(function (c) { // throw out any that are not relevant for whatever reason - return c.length; - }); + return c.length + }) if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); + throw new TypeError('Invalid SemVer Range: ' + range) } - this.format(); + this.format() } -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; +Range.prototype.format = function () { + this.range = this.set.map(function (comps) { + return comps.join(' ').trim() + }).join('||').trim() + return this.range +} -Range.prototype.toString = function() { - return this.range; -}; +Range.prototype.toString = function () { + return this.range +} -Range.prototype.parseRange = function(range) { - var loose = this.options.loose; - range = range.trim(); +Range.prototype.parseRange = function (range) { + var loose = this.options.loose + range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug('hyphen replace', range); + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] + range = range.replace(hr, hyphenReplace) + debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - debug('comparator trim', range, re[COMPARATORTRIM]); + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range, re[COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); + range = range.replace(re[TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); + range = range.replace(re[CARETTRIM], caretTrimReplace) // normalize spaces - range = range.split(/\s+/).join(' '); + range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(' ').split(/\s+/); + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] + var set = range.split(' ').map(function (comp) { + return parseComparator(comp, this.options) + }, this).join(' ').split(/\s+/) if (this.options.loose) { // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); + set = set.filter(function (comp) { + return !!comp.match(compRe) + }) } - set = set.map(function(comp) { - return new Comparator(comp, this.options); - }, this); + set = set.map(function (comp) { + return new Comparator(comp, this.options) + }, this) - return set; -}; + return set +} -Range.prototype.intersects = function(range, options) { +Range.prototype.intersects = function (range, options) { if (!(range instanceof Range)) { - throw new TypeError('a Range is required'); + throw new TypeError('a Range is required') } - return this.set.some(function(thisComparators) { - return thisComparators.every(function(thisComparator) { - return range.set.some(function(rangeComparators) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); -}; + return this.set.some(function (thisComparators) { + return thisComparators.every(function (thisComparator) { + return range.set.some(function (rangeComparators) { + return rangeComparators.every(function (rangeComparator) { + return thisComparator.intersects(rangeComparator, options) + }) + }) + }) + }) +} // Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, options) { - return new Range(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); +exports.toComparators = toComparators +function toComparators (range, options) { + return new Range(range, options).set.map(function (comp) { + return comp.map(function (c) { + return c.value + }).join(' ').trim().split(' ') + }) } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. -function parseComparator(comp, options) { - debug('comp', comp, options); - comp = replaceCarets(comp, options); - debug('caret', comp); - comp = replaceTildes(comp, options); - debug('tildes', comp); - comp = replaceXRanges(comp, options); - debug('xrange', comp); - comp = replaceStars(comp, options); - debug('stars', comp); - return comp; +function parseComparator (comp, options) { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp } -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; +function isX (id) { + return !id || id.toLowerCase() === 'x' || id === '*' } // ~, ~> --> * (any, kinda silly) @@ -914,41 +980,38 @@ function isX(id) { // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, options); - }).join(' '); +function replaceTildes (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceTilde(comp, options) + }).join(' ') } -function replaceTilde(comp, options) { - if (!options || typeof options !== 'object') - options = { loose: !!options, includePrerelease: false } - var r = options.loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr); - var ret; +function replaceTilde (comp, options) { + var r = options.loose ? re[TILDELOOSE] : re[TILDE] + return comp.replace(r, function (_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr) + var ret - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0 - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else if (pr) { - debug('replaceTilde pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else if (pr) { + debug('replaceTilde pr', pr) + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } else { // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; + ' <' + M + '.' + (+m + 1) + '.0' + } - debug('tilde return', ret); - return ret; - }); + debug('tilde return', ret) + return ret + }) } // ^ --> * (any, kinda silly) @@ -957,142 +1020,144 @@ function replaceTilde(comp, options) { // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, options); - }).join(' '); +function replaceCarets (comp, options) { + return comp.trim().split(/\s+/).map(function (comp) { + return replaceCaret(comp, options) + }).join(' ') } -function replaceCaret(comp, options) { - debug('caret', comp, options); - if (!options || typeof options !== 'object') - options = { loose: !!options, includePrerelease: false } - var r = options.loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr); - var ret; +function replaceCaret (comp, options) { + debug('caret', comp, options) + var r = options.loose ? re[CARETLOOSE] : re[CARET] + return comp.replace(r, function (_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr) + var ret - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) { - if (M === '0') - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' + } else if (isX(p)) { + if (M === '0') { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' + } else { + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' + } } else if (pr) { - debug('replaceCaret pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; + debug('replaceCaret pr', pr) if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0'; + if (m === '0') { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + m + '.' + (+p + 1) + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { + ret = '>=' + M + '.' + m + '.' + p + '-' + pr + + ' <' + (+M + 1) + '.0.0' + } } else { - debug('no pr'); + debug('no pr') if (M === '0') { - if (m === '0') + if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1); - else + ' <' + M + '.' + m + '.' + (+p + 1) + } else { ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - } else + ' <' + M + '.' + (+m + 1) + '.0' + } + } else { ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0'; + ' <' + (+M + 1) + '.0.0' + } } - debug('caret return', ret); - return ret; - }); + debug('caret return', ret) + return ret + }) } -function replaceXRanges(comp, options) { - debug('replaceXRanges', comp, options); - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, options); - }).join(' '); +function replaceXRanges (comp, options) { + debug('replaceXRanges', comp, options) + return comp.split(/\s+/).map(function (comp) { + return replaceXRange(comp, options) + }).join(' ') } -function replaceXRange(comp, options) { - comp = comp.trim(); - if (!options || typeof options !== 'object') - options = { loose: !!options, includePrerelease: false } - var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; +function replaceXRange (comp, options) { + comp = comp.trim() + var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] + return comp.replace(r, function (ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + var xM = isX(M) + var xm = xM || isX(m) + var xp = xm || isX(p) + var anyX = xp - if (gtlt === '=' && anyX) - gtlt = ''; + if (gtlt === '=' && anyX) { + gtlt = '' + } if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed - ret = '<0.0.0'; + ret = '<0.0.0' } else { // nothing is forbidden - ret = '*'; + ret = '*' } } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. // replace X with 0 - if (xm) - m = 0; - if (xp) - p = 0; + if (xm) { + m = 0 + } + p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 - gtlt = '>='; + gtlt = '>=' if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<'; - if (xm) - M = +M + 1; - else - m = +m + 1; + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } } - ret = gtlt + M + '.' + m + '.' + p; + ret = gtlt + M + '.' + m + '.' + p } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } - debug('xRange return', ret); + debug('xRange return', ret) - return ret; - }); + return ret + }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. -function replaceStars(comp, options) { - debug('replaceStars', comp, options); +function replaceStars (comp, options) { + debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); + return comp.trim().replace(re[STAR], '') } // This function is passed to string.replace(re[HYPHENRANGE]) @@ -1100,253 +1165,319 @@ function replaceStars(comp, options) { // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { +function hyphenReplace ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = '>=' + fM + '.0.0' + } else if (isX(fp)) { + from = '>=' + fM + '.' + fm + '.0' + } else { + from = '>=' + from + } - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0'; - else - from = '>=' + from; + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = '<' + (+tM + 1) + '.0.0' + } else if (isX(tp)) { + to = '<' + tM + '.' + (+tm + 1) + '.0' + } else if (tpr) { + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr + } else { + to = '<=' + to + } - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); + return (from + ' ' + to).trim() } - // if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; +Range.prototype.test = function (version) { + if (!version) { + return false + } - if (typeof version === 'string') - version = new SemVer(version, this.options); + if (typeof version === 'string') { + version = new SemVer(version, this.options) + } for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) - return true; + if (testSet(this.set[i], version, this.options)) { + return true + } } - return false; -}; + return false +} -function testSet(set, version, options) { +function testSet (set, version, options) { for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; + if (!set[i].test(version)) { + return false + } } - if (!options) - options = {} - if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. - for (var i = 0; i < set.length; i++) { - debug(set[i].semver); - if (set[i].semver === ANY) - continue; + for (i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === ANY) { + continue + } if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; + var allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && - allowed.patch === version.patch) - return true; + allowed.patch === version.patch) { + return true + } } } // Version has a -pre, but it's not one of the ones we like. - return false; + return false } - return true; + return true } -exports.satisfies = satisfies; -function satisfies(version, range, options) { +exports.satisfies = satisfies +function satisfies (version, range, options) { try { - range = new Range(range, options); + range = new Range(range, options) } catch (er) { - return false; + return false } - return range.test(version); + return range.test(version) } -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; +exports.maxSatisfying = maxSatisfying +function maxSatisfying (versions, range, options) { + var max = null + var maxSV = null try { - var rangeObj = new Range(range, options); + var rangeObj = new Range(range, options) } catch (er) { - return null; + return null } versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, options) - if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) - max = v; - maxSV = new SemVer(max, options); + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) } } }) - return max; + return max } -exports.minSatisfying = minSatisfying; -function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; +exports.minSatisfying = minSatisfying +function minSatisfying (versions, range, options) { + var min = null + var minSV = null try { - var rangeObj = new Range(range, options); + var rangeObj = new Range(range, options) } catch (er) { - return null; + return null } versions.forEach(function (v) { - if (rangeObj.test(v)) { // satisfies(v, range, options) - if (!min || minSV.compare(v) === 1) { // compare(min, v, true) - min = v; - minSV = new SemVer(min, options); + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) } } }) - return min; + return min } -exports.validRange = validRange; -function validRange(range, options) { +exports.minVersion = minVersion +function minVersion (range, loose) { + range = new Range(range, loose) + + var minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i] + + comparators.forEach(function (comparator) { + // Clone to avoid manipulating the comparator's semver object. + var compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!minver || gt(minver, compver)) { + minver = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error('Unexpected operation: ' + comparator.operator) + } + }) + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} + +exports.validRange = validRange +function validRange (range, options) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway - return new Range(range, options).range || '*'; + return new Range(range, options).range || '*' } catch (er) { - return null; + return null } } // Determine if version is less than all the versions possible in the range -exports.ltr = ltr; -function ltr(version, range, options) { - return outside(version, range, '<', options); +exports.ltr = ltr +function ltr (version, range, options) { + return outside(version, range, '<', options) } // Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr; -function gtr(version, range, options) { - return outside(version, range, '>', options); +exports.gtr = gtr +function gtr (version, range, options) { + return outside(version, range, '>', options) } -exports.outside = outside; -function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range(range, options); +exports.outside = outside +function outside (version, range, hilo, options) { + version = new SemVer(version, options) + range = new Range(range, options) - var gtfn, ltefn, ltfn, comp, ecomp; + var gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisifes the range it is not outside if (satisfies(version, range, options)) { - return false; + return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; + var comparators = range.set[i] - var high = null; - var low = null; + var high = null + var low = null - comparators.forEach(function(comparator) { + comparators.forEach(function (comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } - high = high || comparator; - low = low || comparator; + high = high || comparator + low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; + high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; + low = comparator } - }); + }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { - return false; + return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; + return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + return false } } - return true; + return true } -exports.prerelease = prerelease; -function prerelease(version, options) { - var parsed = parse(version, options); - return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; +exports.prerelease = prerelease +function prerelease (version, options) { + var parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } -exports.intersects = intersects; -function intersects(r1, r2, options) { +exports.intersects = intersects +function intersects (r1, r2, options) { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } -exports.coerce = coerce; -function coerce(version) { - if (version instanceof SemVer) - return version; +exports.coerce = coerce +function coerce (version) { + if (version instanceof SemVer) { + return version + } - if (typeof version !== 'string') - return null; + if (typeof version !== 'string') { + return null + } - var match = version.match(re[COERCE]); + var match = version.match(re[COERCE]) - if (match == null) - return null; + if (match == null) { + return null + } - return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); + return parse(match[1] + + '.' + (match[2] || '0') + + '.' + (match[3] || '0')) } diff --git a/node_modules/showdown/package.json b/node_modules/showdown/package.json index 5b5c683..34f2603 100644 --- a/node_modules/showdown/package.json +++ b/node_modules/showdown/package.json @@ -49,10 +49,10 @@ }, "contributors": [ { - "name": "John Fraser" + "name": "John Gruber" }, { - "name": "Cat Chen" + "name": "John Fraser" }, { "name": "Corey Innis" @@ -70,7 +70,7 @@ "name": "Dominic Tarr" }, { - "name": "John Gruber" + "name": "Cat Chen" }, { "name": "Titus Stone" diff --git a/node_modules/socksv5/node_modules/.bin/ipv6 b/node_modules/socksv5/node_modules/.bin/ipv6 new file mode 120000 index 0000000..41750dd --- /dev/null +++ b/node_modules/socksv5/node_modules/.bin/ipv6 @@ -0,0 +1 @@ +../ipv6/bin/ipv6.js \ No newline at end of file diff --git a/node_modules/socksv5/node_modules/.bin/ipv6grep b/node_modules/socksv5/node_modules/.bin/ipv6grep new file mode 120000 index 0000000..d8a4f9b --- /dev/null +++ b/node_modules/socksv5/node_modules/.bin/ipv6grep @@ -0,0 +1 @@ +../ipv6/bin/ipv6grep.js \ No newline at end of file diff --git a/node_modules/spdx-license-ids/README.md b/node_modules/spdx-license-ids/README.md index c7b5b5f..699514d 100644 --- a/node_modules/spdx-license-ids/README.md +++ b/node_modules/spdx-license-ids/README.md @@ -1,13 +1,13 @@ # spdx-license-ids -[![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.org/package/spdx-license-ids) -[![Build Status](https://travis-ci.org/shinnn/spdx-license-ids.svg?branch=master)](https://travis-ci.org/shinnn/spdx-license-ids) +[![npm version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.com/package/spdx-license-ids) +[![Github Actions](https://action-badges.now.sh/shinnn/spdx-license-ids)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/spdx-license-ids) A list of [SPDX license](https://spdx.org/licenses/) identifiers ## Installation -[Download JSON directly](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm): +[Download JSON directly](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/): ``` npm install spdx-license-ids @@ -17,13 +17,13 @@ npm install spdx-license-ids ### require('spdx-license-ids') -Type: `>` +Type: `string[]` All license IDs except for the currently deprecated ones. ```javascript const ids = require('spdx-license-ids'); -//=> ['0BSD', 'AAL', 'Abstyles', 'Adobe-2006', 'Adobe-Glyph', 'ADSL', 'AFL-1.1', 'AFL-1.2', ...] +//=> ['0BSD', 'AAL', 'ADSL', 'AFL-1.1', 'AFL-1.2', 'AFL-2.0', 'AFL-2.1', 'AFL-3.0', 'AGPL-1.0-only', ...] ids.includes('BSD-3-Clause'); //=> true ids.includes('CC-BY-1.0'); //=> true @@ -33,13 +33,13 @@ ids.includes('GPL-3.0'); //=> false ### require('spdx-license-ids/deprecated') -Type: `>` +Type: `string[]` Deprecated license IDs. ```javascript const deprecatedIds = require('spdx-license-ids/deprecated'); -//=> ['AGPL-1.0', 'AGPL-3.0', 'eCos-2.0', 'GFDL-1.1', 'GFDL-1.2', 'GFDL-1.3', 'GPL-1.0', ...] +//=> ['AGPL-1.0', 'AGPL-3.0', 'GFDL-1.1', 'GFDL-1.2', 'GFDL-1.3', 'GPL-1.0', 'GPL-2.0', ...] deprecatedIds.includes('BSD-3-Clause'); //=> false deprecatedIds.includes('CC-BY-1.0'); //=> false diff --git a/node_modules/spdx-license-ids/index.json b/node_modules/spdx-license-ids/index.json index ed06199..1e9f9e0 100644 --- a/node_modules/spdx-license-ids/index.json +++ b/node_modules/spdx-license-ids/index.json @@ -98,6 +98,8 @@ "CECILL-2.1", "CECILL-B", "CECILL-C", + "CERN-OHL-1.1", + "CERN-OHL-1.2", "CNRI-Jython", "CNRI-Python", "CNRI-Python-GPL-Compatible", @@ -152,6 +154,7 @@ "Glide", "Glulxe", "HPND", + "HPND-sell-variant", "HaskellReport", "IBM-pibs", "ICU", @@ -165,6 +168,7 @@ "Intel", "Intel-ACPI", "Interbase-1.0", + "JPNIC", "JSON", "JasPer-2.0", "LAL-1.2", @@ -299,6 +303,7 @@ "Spencer-94", "Spencer-99", "SugarCRM-1.1.3", + "TAPR-OHL-1.0", "TCL", "TCP-wrappers", "TMate", @@ -346,6 +351,7 @@ "gSOAP-1.3b", "gnuplot", "iMatix", + "libpng-2.0", "libtiff", "mpich2", "psfrag", diff --git a/node_modules/spdx-license-ids/package.json b/node_modules/spdx-license-ids/package.json index 7c6209c..b59bdbf 100644 --- a/node_modules/spdx-license-ids/package.json +++ b/node_modules/spdx-license-ids/package.json @@ -7,20 +7,20 @@ ], "_from": "spdx-license-ids@>=3.0.0 <4.0.0", "_hasShrinkwrap": false, - "_id": "spdx-license-ids@3.0.3", + "_id": "spdx-license-ids@3.0.4", "_inCache": true, "_installable": true, "_location": "/spdx-license-ids", - "_nodeVersion": "11.5.0", + "_nodeVersion": "11.13.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/spdx-license-ids_3.0.3_1545328211681_0.5619309731207645" + "tmp": "tmp/spdx-license-ids_3.0.4_1554558683841_0.32336491674892054" }, "_npmUser": { "email": "snnskwtnb@gmail.com", "name": "shinnn" }, - "_npmVersion": "6.5.0", + "_npmVersion": "6.9.0", "_phantomChildren": {}, "_requested": { "name": "spdx-license-ids", @@ -34,8 +34,8 @@ "/spdx-correct", "/spdx-expression-parse" ], - "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "_shasum": "81c0ce8f21474756148bbb5f3bfc0f36bf15d76e", + "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "_shasum": "75ecd1a88de8c184ef015eafb51b5b48bfd11bb1", "_shrinkwrap": null, "_spec": "spdx-license-ids@^3.0.0", "_where": "/mnt/c/Users/Josua/Desktop/data/nodejs/electron/chat-project/chat-client/node_modules/spdx-correct", @@ -59,16 +59,16 @@ "directories": {}, "dist": { "fileCount": 4, - "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", - "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcG9ZUCRA9TVsSAnZWagAAYpMQAJGFwQcE0djxBCqxO7wX\nuZSy5PkzHhLdygj5zEFHJsMUbAyXC0rMPZNhb2Z9ezYWTS48o08fzVGpUYEl\nym+ZVWy/VfoytzGraZpPGV/vSOds4aEMbqPZK1L2gxLdfjbAA2kkwEumz7y/\nqem/ib3XvNowz7NBH33msXZdQmFa6wmu3Ga9/msElrrwxcF2uOqpQliIj/ij\nJJ8TgIAw68Sf4xYHSSOAX93tDkmtAvKc/MKiEIGxyHumBjcoH7t9i/hrj76y\nOE3t81zQxKJht/MJY6y3mACuGYGyYSkpS1UkYgYyHrZLUDKTbOygM/0cLtJF\n7cfZmoL99KPabzx8ZTDaeqb9IUp07zIQ67etdHjK030V6JyOSzjas2zDgy9j\n3fS+2IVJkaa8qoDcteY7WjK9iGoVrQduCg+hf6GmM0aVixDjCDtcXkCU4LNW\nHssDBDKtqQ40XZOTGzKbfClYNaLkNh8EQtA2aSDfe5gM6HsmMHHWHnspjeOJ\nV0s8NSy90tiqX1FYlTcab3kw09/IbakQSu8BERXZUI6xlx0pSu988Tn/09Df\n9RnxQCpOii+xn1QykMmLQa21Ocv5YmemlIN/BxZAOAfR4VRE3TvsKxdwyFY6\n1KJA/DQkRdjNVd8ayot1s0n5IPqtnOe2rKIgqRfUT3PQdYoK8PiHlpjIHNCd\nxzyO\r\n=xoiU\r\n-----END PGP SIGNATURE-----\r\n", - "shasum": "81c0ce8f21474756148bbb5f3bfc0f36bf15d76e", - "tarball": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "unpackedSize": 7785 + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcqK7cCRA9TVsSAnZWagAALWMP/1nr34W51ig8XQFRGAEY\n+TwOah3IAE5kQ5QEi047RtiPU66qGKmBRHZE0+rgRrcoIwIlPEUO7kKMt4RZ\n6jKTQ5QeLKst88NOQIzxJsRam85r5/fakCvdXjE+4mnVqYoI7kWLnnl7RTB/\n/VDpZONMgfdV3G2vTnf/OojDnz/7zhgQih/H7iA32WY5kzyF8fAY7/WvMjBc\nI3A1M47vmUTPyYv45qjZ5z7TC7b1wz3omatNnMVE0Mf1XIBTv/JJzyhXdZ9F\ndCuDuIQNEPZZKj3FTY/b28f76VxkuUohgxFWjRf97ge7Oi7XOBjw1JkHCHY/\nc4cmj0bJ4dlHVfvlgMJb2G+8dhhxj4GwBiF+c4enKSiIO/jR/51wPbGagbYS\nOoKpF1HqHA1CskPSeeqpk8rH2aO5CJafsWSFWQa//13HqD9L9Fo7mZsn8uaD\nwPO7v3PcJS7R2wqKtF14DUndyKDp3F8Da3gmXW9wH21T5Df2ZX2MCoCzkHdE\nCj3DCV36QLJGW9rLCJ4neoBjkfKz6ifZ7nwPFITQ2xtXG4artemSMHAXQpnC\n1SN9RICQzRQ1m14p316fQTAovWbmXpB0Ysohhuk7oMappntvjiMnZu21k6LG\nuBiFdoIzjbeX/wla4cmqeYh+9Nyf16VGAbY7AwMvU6sU3yNvfnKntBEIzT1R\nLxCB\r\n=sw+A\r\n-----END PGP SIGNATURE-----\r\n", + "shasum": "75ecd1a88de8c184ef015eafb51b5b48bfd11bb1", + "tarball": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "unpackedSize": 7903 }, "eslintConfig": { "extends": "@shinnn" }, - "gitHead": "9a23c2a5f1f6371ed61fc0ca81b79143020e027a", + "gitHead": "09f914ab6c75354b80c18d8343c5dbbd210adcb3", "homepage": "https://github.com/shinnn/spdx-license-ids#readme", "keywords": [ "array", @@ -100,5 +100,5 @@ "pretest": "eslint .", "test": "node test.js" }, - "version": "3.0.3" + "version": "3.0.4" } diff --git a/proxy.js b/proxy.js new file mode 100644 index 0000000..ddcdcde --- /dev/null +++ b/proxy.js @@ -0,0 +1,47 @@ + +// Require some libraries +var proxysocket = require("proxysocket"); +var net = require("net"); + +// Set the first varible +var first = true; + +// Setup the proxy varible +var proxy; + +// Wait for a message from the client +process.on('message', function(data) +{ + // Is this the first time called + if(first) + { + // Set first + first = false; + + // Parse the data + data = JSON.parse(data); + + // Connect to the proxy + proxy = proxysocket.create(data.proxy.host, data.proxy.port); + + // Start a connection + proxy.connect(data.connect.port, data.connect.host, function() + { + // Send a status message + process.send("connected"); + + // Wait for data from the proxy + proxy.on("data", function(data) + { + // Send the data to the client + process.send(data); + }); + }) + } + + else + { + // Send the data to the proxy + proxy.write(Buffer(data)); + } +}); diff --git a/scripts/communications.js b/scripts/communications.js index b8dcbf8..1f549f0 100644 --- a/scripts/communications.js +++ b/scripts/communications.js @@ -47,6 +47,130 @@ function toBytes(buffer) return bytes; } +function socks_new(hostname, port) +{ + // Setup some handles + var connect_handle; + var close_handle; + var data_handle; + + // Set the first varible + var first = true; + + // Proxy task + var proxy = child_process.fork( + path.resolve('proxy.js'), [], + { + stdio: [ 'pipe', 'pipe', 'pipe', 'ipc' ], + silent: false, + execPath: "/usr/bin/node" + } + ); + + // Wait for a message + proxy.on("message", function(data) + { + // If first + if(first) + { + // If the data is the initial connection + if(data == "connected") + { + // Set first to false + first = false; + + // Call the connect handle + connect_handle(); + } + } + + else + { + // Call the data handle + data_handle(Buffer.from(data)); + } + }); + + proxy.stdout.on("data", function(data) + { + console.log("socks_new stdout:", data.toString()) + }) + + proxy.stderr.on("data", function(data) + { + console.log("socks_new stderr:", data.toString()) + }) + + var options = { + connect: function(s_port, s_hostname, callback) + { + // Send some data + proxy.send(JSON.stringify({ + connect: { + host: s_hostname, + port: s_port + }, + proxy: { + host: hostname, + port: port + } + })); + + // Set the connect handle + connect_handle = callback; + }, + + on: function(watch, callback) + { + // On data + if(watch == "data") + { + // Set the callback + data_handle = callback; + } + + // On close + if(watch == "close") + { + // Set the callback + close_handle = callback; + + // Set the close handle + proxy.on("close", close_handle); + } + }, + + write: function(data) + { + // Send the specified data + proxy.send(data); + }, + + destroy: function() + { + // Destroy the proxy + proxy.kill(); + } + }; + + return options; +} + +function test_socks_test(text) +{ + var socket = socks_new("localhost", 8080) + socket.on("data", function(data) + { + console.log(data.toString()) + socket.destroy(); + }); + socket.connect(12346,"192.168.1.14",function() + { + console.log("connected") + }); + socket.write(text); +} + // Recieve helper global varibles var recieve_buffer = new Buffer.alloc(0); var recieve_get = false; @@ -271,8 +395,24 @@ function connect(profile, connection_id) g.raw_encryption_data_size = 0; // Create a client - var client = new net.Socket(); - g.client = client; + var client; + + // Is this direct mode + if(profile.mode == "direct") + { + // Set the client to a direct connection + client = new net.Socket(); + g.client = client; + } + + // Is this socks5 mode + if(profile.mode == "socks5") + { + // Set the client as a socks proxy + client = socks_new(profile.proxy.hostname, profile.proxy.port); + console.log("Connecting with socks5", profile.proxy.hostname, profile.proxy.port) + g.client = client; + } function rsa_task_send(data) { @@ -281,8 +421,10 @@ function connect(profile, connection_id) } // Connect to the server + console.log(profile.mode, port, hostname, client) client.connect(port, hostname, function() { + console.log("Connected", profile.mode); // Load the RSA key rsa_task_send({ mode: "load" @@ -490,6 +632,9 @@ function connect(profile, connection_id) // Save the details g.username = profile.username; + + // Kill the process, nolonger needed + g.rsa_task.kill(); } }); diff --git a/scripts/include.js b/scripts/include.js index 928b4fa..8ea10b5 100644 --- a/scripts/include.js +++ b/scripts/include.js @@ -1,13 +1,14 @@ // Get some libraries -const fs = require("fs"); -const net = require("net"); -const path = require("path"); -const node_rsa = require("node-rsa"); -const bsplit = require("buffer-split"); +const fs = require('fs'); +const net = require('net'); +const path = require('path'); +const node_rsa = require('node-rsa'); +const bsplit = require('buffer-split'); const child_process = require('child_process'); -const showdown = require("showdown"); -const open = require("open"); +const proxysocket = require('proxysocket'); +const showdown = require('showdown'); +const open = require('open'); // Create the markdown converter var md = new showdown.Converter(); diff --git a/scripts/profiles.js b/scripts/profiles.js index 1f745f5..ae945c1 100644 --- a/scripts/profiles.js +++ b/scripts/profiles.js @@ -50,14 +50,31 @@ function profile_save() var port = document.getElementById("edit_profile_port").value; var username = document.getElementById("edit_profile_username").value; var password = document.getElementById("edit_profile_password").value; + var proxy_host = document.getElementById("edit_profile_proxy_hostname").value; + var proxy_port = document.getElementById("edit_profile_proxy_port").value; + var mode = document.getElementById("edit_profile_mode").value; - // Push the profiles data - profiles.push({ + // Create the profile structure + var profile = { hostname: hostname, port: port, username: username, - password: password - }); + password: password, + mode: mode + }; + + // Is this socks5 mode + if(mode == "socks5") + { + // Create a proxy structure + profile.proxy = { + hostname: proxy_host, + port: parseInt(proxy_port) + }; + } + + // Push the profile + profiles.push(profile); // Write the data to the profiles file profiles_export(); @@ -236,6 +253,9 @@ function chat_switch_to(id) // Scroll to the bottom of the div chat_content.scrollTop = chat_content.scrollHeight; + + // Focus the text area + document.getElementById("chat-content-send-textarea").focus(); } // Register this to happen when shift enter is pressed in the textarea @@ -350,6 +370,28 @@ function profiles_reload() } } +function edit_profile_mode_update() +{ + // Get the mode + var mode = document.getElementById("edit_profile_mode").value; + + // Is the mode direct + if(mode == "direct") + { + // Clear the extra settings + $(".edit_profile_proxy_section").addClass("off"); + $(".edit_profile_proxy_section").removeClass("on"); + } + + // Is the mode socks5 + if(mode == "socks5") + { + // Set some extra settings + $(".edit_profile_proxy_section").addClass("on"); + $(".edit_profile_proxy_section").removeClass("off"); + } +} + function switch_new_profile() { // Set the html @@ -362,6 +404,16 @@ function switch_new_profile() Port\ Username\ Password\ + Mode\ + \ + \ + Proxy Host\ + \ + Proxy Port\ + \ \ \

\ diff --git a/style.css b/style.css index b5bc82b..e9724a2 100644 --- a/style.css +++ b/style.css @@ -108,3 +108,8 @@ .chat-content-message p { word-break: break-all; } + +.edit_profile_proxy_section.off { + position: fixed; + visibility: hidden; +}