typespeed 2.0.13 → 2.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.decorator.js +0 -1
- package/dist/database.decorator.js +0 -1
- package/dist/default/express-server.class.js +0 -1
- package/dist/default/log-default.class.js +0 -1
- package/dist/default/node-cache.class.js +0 -1
- package/dist/default/rabbitmq.class.js +0 -1
- package/dist/default/read-write-db.class.js +0 -1
- package/dist/default/redis.class.js +0 -1
- package/dist/factory/cache-factory.class.js +0 -1
- package/dist/factory/data-source-factory.class.js +0 -1
- package/dist/factory/log-factory.class.js +0 -1
- package/dist/factory/server-factory.class.js +0 -1
- package/dist/route.decorator.js +0 -1
- package/dist/scaffold/command.js +0 -1
- package/dist/typespeed.d.ts +133 -12
- package/dist/typespeed.js +1 -1
- package/package.json +2 -2
- package/src/typespeed.d.ts +133 -0
- package/src/typespeed.ts +2 -1
- package/test/node_modules/.package-lock.json +112 -4
- package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-ci.yml +17 -0
- package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-publish.yml +30 -0
- package/test/node_modules/@acuminous/bitsyntax/LICENSE +6 -0
- package/test/node_modules/@acuminous/bitsyntax/LICENSE-MIT +21 -0
- package/test/node_modules/@acuminous/bitsyntax/Makefile +15 -0
- package/test/node_modules/@acuminous/bitsyntax/README.md +308 -0
- package/test/node_modules/@acuminous/bitsyntax/index.js +10 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/compile.js +303 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/constructor.js +142 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/grammar.pegjs +67 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/interp.js +232 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/parse.js +32 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/parser.js +1173 -0
- package/test/node_modules/@acuminous/bitsyntax/lib/pattern.js +119 -0
- package/test/node_modules/@acuminous/bitsyntax/package.json +36 -0
- package/test/node_modules/@acuminous/bitsyntax/test/consing.test.js +50 -0
- package/test/node_modules/@acuminous/bitsyntax/test/matching.test.js +193 -0
- package/test/node_modules/@types/node/README.md +1 -1
- package/test/node_modules/@types/node/buffer.d.ts +5 -2
- package/test/node_modules/@types/node/child_process.d.ts +27 -0
- package/test/node_modules/@types/node/globals.d.ts +1 -0
- package/test/node_modules/@types/node/package.json +2 -2
- package/test/node_modules/@types/node/test.d.ts +43 -20
- package/test/node_modules/@types/node/ts4.8/buffer.d.ts +5 -2
- package/test/node_modules/@types/node/ts4.8/child_process.d.ts +27 -0
- package/test/node_modules/@types/node/ts4.8/globals.d.ts +1 -0
- package/test/node_modules/@types/node/ts4.8/test.d.ts +43 -19
- package/test/node_modules/@types/node/ts4.8/url.d.ts +3 -3
- package/test/node_modules/@types/node/ts4.8/util.d.ts +1 -1
- package/test/node_modules/@types/node/url.d.ts +3 -3
- package/test/node_modules/@types/node/util.d.ts +1 -1
- package/test/node_modules/amqplib/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/test/node_modules/amqplib/.github/workflows/test.yml +38 -0
- package/test/node_modules/amqplib/CHANGELOG.md +430 -0
- package/test/node_modules/amqplib/LICENSE +6 -0
- package/test/node_modules/amqplib/LICENSE-MIT +21 -0
- package/test/node_modules/amqplib/Makefile +47 -0
- package/test/node_modules/amqplib/README.md +157 -0
- package/test/node_modules/amqplib/bin/generate-defs.js +722 -0
- package/test/node_modules/amqplib/callback_api.js +22 -0
- package/test/node_modules/amqplib/channel_api.js +16 -0
- package/test/node_modules/amqplib/examples/headers.js +42 -0
- package/test/node_modules/amqplib/examples/receive_generator.js +39 -0
- package/test/node_modules/amqplib/examples/send_generators.js +42 -0
- package/test/node_modules/amqplib/examples/ssl.js +64 -0
- package/test/node_modules/amqplib/examples/tutorials/README.md +93 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log.js +28 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_direct.js +30 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_topic.js +27 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/new_task.js +27 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive.js +30 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs.js +36 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_direct.js +56 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_topic.js +55 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_client.js +49 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_server.js +45 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/send.js +29 -0
- package/test/node_modules/amqplib/examples/tutorials/callback_api/worker.js +35 -0
- package/test/node_modules/amqplib/examples/tutorials/emit_log.js +19 -0
- package/test/node_modules/amqplib/examples/tutorials/emit_log_direct.js +20 -0
- package/test/node_modules/amqplib/examples/tutorials/emit_log_topic.js +19 -0
- package/test/node_modules/amqplib/examples/tutorials/new_task.js +18 -0
- package/test/node_modules/amqplib/examples/tutorials/package.json +16 -0
- package/test/node_modules/amqplib/examples/tutorials/receive.js +21 -0
- package/test/node_modules/amqplib/examples/tutorials/receive_logs.js +28 -0
- package/test/node_modules/amqplib/examples/tutorials/receive_logs_direct.js +44 -0
- package/test/node_modules/amqplib/examples/tutorials/receive_logs_topic.js +43 -0
- package/test/node_modules/amqplib/examples/tutorials/rpc_client.js +52 -0
- package/test/node_modules/amqplib/examples/tutorials/rpc_server.js +39 -0
- package/test/node_modules/amqplib/examples/tutorials/send.js +23 -0
- package/test/node_modules/amqplib/examples/tutorials/worker.js +28 -0
- package/test/node_modules/amqplib/examples/waitForConfirms.js +22 -0
- package/test/node_modules/amqplib/lib/api_args.js +314 -0
- package/test/node_modules/amqplib/lib/bitset.js +130 -0
- package/test/node_modules/amqplib/lib/callback_model.js +327 -0
- package/test/node_modules/amqplib/lib/channel.js +499 -0
- package/test/node_modules/amqplib/lib/channel_model.js +302 -0
- package/test/node_modules/amqplib/lib/codec.js +321 -0
- package/test/node_modules/amqplib/lib/connect.js +189 -0
- package/test/node_modules/amqplib/lib/connection.js +663 -0
- package/test/node_modules/amqplib/lib/credentials.js +42 -0
- package/test/node_modules/amqplib/lib/defs.js +4966 -0
- package/test/node_modules/amqplib/lib/error.js +24 -0
- package/test/node_modules/amqplib/lib/format.js +40 -0
- package/test/node_modules/amqplib/lib/frame.js +113 -0
- package/test/node_modules/amqplib/lib/heartbeat.js +89 -0
- package/test/node_modules/amqplib/lib/mux.js +129 -0
- package/test/node_modules/amqplib/package.json +37 -0
- package/test/node_modules/amqplib/test/bitset.js +69 -0
- package/test/node_modules/amqplib/test/callback_api.js +312 -0
- package/test/node_modules/amqplib/test/channel.js +621 -0
- package/test/node_modules/amqplib/test/channel_api.js +596 -0
- package/test/node_modules/amqplib/test/codec.js +237 -0
- package/test/node_modules/amqplib/test/connect.js +197 -0
- package/test/node_modules/amqplib/test/connection.js +390 -0
- package/test/node_modules/amqplib/test/data.js +254 -0
- package/test/node_modules/amqplib/test/frame.js +198 -0
- package/test/node_modules/amqplib/test/mux.js +204 -0
- package/test/node_modules/amqplib/test/util.js +219 -0
- package/test/node_modules/buffer-more-ints/.travis.yml +6 -0
- package/test/node_modules/buffer-more-ints/LICENSE +19 -0
- package/test/node_modules/buffer-more-ints/README.md +69 -0
- package/test/node_modules/buffer-more-ints/buffer-more-ints-tests.js +183 -0
- package/test/node_modules/buffer-more-ints/buffer-more-ints.js +432 -0
- package/test/node_modules/buffer-more-ints/package.json +19 -0
- package/test/node_modules/buffer-more-ints/polyfill.js +71 -0
- package/test/node_modules/core-util-is/LICENSE +19 -0
- package/test/node_modules/core-util-is/README.md +3 -0
- package/test/node_modules/core-util-is/lib/util.js +107 -0
- package/test/node_modules/core-util-is/package.json +38 -0
- package/test/node_modules/debug/LICENSE +20 -0
- package/test/node_modules/debug/README.md +481 -0
- package/test/node_modules/debug/package.json +59 -0
- package/test/node_modules/debug/src/browser.js +269 -0
- package/test/node_modules/debug/src/common.js +274 -0
- package/test/node_modules/debug/src/index.js +10 -0
- package/test/node_modules/debug/src/node.js +263 -0
- package/test/node_modules/inherits/LICENSE +16 -0
- package/test/node_modules/inherits/README.md +42 -0
- package/test/node_modules/inherits/inherits.js +9 -0
- package/test/node_modules/inherits/inherits_browser.js +27 -0
- package/test/node_modules/inherits/package.json +29 -0
- package/test/node_modules/isarray/README.md +54 -0
- package/test/node_modules/isarray/build/build.js +209 -0
- package/test/node_modules/isarray/component.json +19 -0
- package/test/node_modules/isarray/index.js +3 -0
- package/test/node_modules/isarray/package.json +25 -0
- package/test/node_modules/ms/index.js +162 -0
- package/test/node_modules/ms/license.md +21 -0
- package/test/node_modules/ms/package.json +37 -0
- package/test/node_modules/ms/readme.md +60 -0
- package/test/node_modules/querystringify/LICENSE +22 -0
- package/test/node_modules/querystringify/README.md +61 -0
- package/test/node_modules/querystringify/index.js +118 -0
- package/test/node_modules/querystringify/package.json +38 -0
- package/test/node_modules/readable-stream/LICENSE +18 -0
- package/test/node_modules/readable-stream/README.md +15 -0
- package/test/node_modules/readable-stream/duplex.js +1 -0
- package/test/node_modules/readable-stream/float.patch +923 -0
- package/test/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
- package/test/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
- package/test/node_modules/readable-stream/lib/_stream_readable.js +951 -0
- package/test/node_modules/readable-stream/lib/_stream_transform.js +209 -0
- package/test/node_modules/readable-stream/lib/_stream_writable.js +477 -0
- package/test/node_modules/readable-stream/package.json +32 -0
- package/test/node_modules/readable-stream/passthrough.js +1 -0
- package/test/node_modules/readable-stream/readable.js +10 -0
- package/test/node_modules/readable-stream/transform.js +1 -0
- package/test/node_modules/readable-stream/writable.js +1 -0
- package/test/node_modules/requires-port/.travis.yml +19 -0
- package/test/node_modules/requires-port/LICENSE +22 -0
- package/test/node_modules/requires-port/README.md +47 -0
- package/test/node_modules/requires-port/index.js +38 -0
- package/test/node_modules/requires-port/package.json +47 -0
- package/test/node_modules/requires-port/test.js +98 -0
- package/test/node_modules/safe-buffer/LICENSE +21 -0
- package/test/node_modules/safe-buffer/README.md +584 -0
- package/test/node_modules/safe-buffer/index.d.ts +187 -0
- package/test/node_modules/safe-buffer/index.js +62 -0
- package/test/node_modules/safe-buffer/package.json +37 -0
- package/test/node_modules/string_decoder/LICENSE +20 -0
- package/test/node_modules/string_decoder/README.md +7 -0
- package/test/node_modules/string_decoder/index.js +221 -0
- package/test/node_modules/string_decoder/package.json +25 -0
- package/test/node_modules/url-parse/LICENSE +22 -0
- package/test/node_modules/url-parse/README.md +153 -0
- package/test/node_modules/url-parse/dist/url-parse.js +755 -0
- package/test/node_modules/url-parse/dist/url-parse.min.js +1 -0
- package/test/node_modules/url-parse/dist/url-parse.min.js.map +1 -0
- package/test/node_modules/url-parse/index.js +589 -0
- package/test/node_modules/url-parse/package.json +49 -0
- package/test/src/test-mq.class.ts +1 -2
- package/tsconfig.json +4 -3
- package/dist/core.decorator.d.ts +0 -18
- package/dist/core.decorator.js.map +0 -1
- package/dist/database.decorator.d.ts +0 -24
- package/dist/database.decorator.js.map +0 -1
- package/dist/default/express-server.class.d.ts +0 -15
- package/dist/default/express-server.class.js.map +0 -1
- package/dist/default/log-default.class.d.ts +0 -6
- package/dist/default/log-default.class.js.map +0 -1
- package/dist/default/node-cache.class.d.ts +0 -13
- package/dist/default/node-cache.class.js.map +0 -1
- package/dist/default/rabbitmq.class.d.ts +0 -9
- package/dist/default/rabbitmq.class.js.map +0 -1
- package/dist/default/read-write-db.class.d.ts +0 -10
- package/dist/default/read-write-db.class.js.map +0 -1
- package/dist/default/redis.class.d.ts +0 -5
- package/dist/default/redis.class.js.map +0 -1
- package/dist/factory/cache-factory.class.d.ts +0 -7
- package/dist/factory/cache-factory.class.js.map +0 -1
- package/dist/factory/data-source-factory.class.d.ts +0 -4
- package/dist/factory/data-source-factory.class.js.map +0 -1
- package/dist/factory/log-factory.class.d.ts +0 -4
- package/dist/factory/log-factory.class.js.map +0 -1
- package/dist/factory/server-factory.class.d.ts +0 -6
- package/dist/factory/server-factory.class.js.map +0 -1
- package/dist/route.decorator.d.ts +0 -8
- package/dist/route.decorator.js.map +0 -1
- package/dist/scaffold/command.d.ts +0 -2
- package/dist/scaffold/command.js.map +0 -1
- package/dist/typespeed.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "readable-stream",
|
|
3
|
+
"version": "1.1.14",
|
|
4
|
+
"description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x",
|
|
5
|
+
"main": "readable.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"core-util-is": "~1.0.0",
|
|
8
|
+
"isarray": "0.0.1",
|
|
9
|
+
"string_decoder": "~0.10.x",
|
|
10
|
+
"inherits": "~2.0.1"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"tap": "~0.2.6"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "tap test/simple/*.js"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git://github.com/isaacs/readable-stream"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"readable",
|
|
24
|
+
"stream",
|
|
25
|
+
"pipe"
|
|
26
|
+
],
|
|
27
|
+
"browser": {
|
|
28
|
+
"util": false
|
|
29
|
+
},
|
|
30
|
+
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
|
31
|
+
"license": "MIT"
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./lib/_stream_passthrough.js")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
exports = module.exports = require('./lib/_stream_readable.js');
|
|
2
|
+
exports.Stream = require('stream');
|
|
3
|
+
exports.Readable = exports;
|
|
4
|
+
exports.Writable = require('./lib/_stream_writable.js');
|
|
5
|
+
exports.Duplex = require('./lib/_stream_duplex.js');
|
|
6
|
+
exports.Transform = require('./lib/_stream_transform.js');
|
|
7
|
+
exports.PassThrough = require('./lib/_stream_passthrough.js');
|
|
8
|
+
if (!process.browser && process.env.READABLE_STREAM === 'disable') {
|
|
9
|
+
module.exports = require('stream');
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./lib/_stream_transform.js")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./lib/_stream_writable.js")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
sudo: false
|
|
2
|
+
language: node_js
|
|
3
|
+
node_js:
|
|
4
|
+
- "4"
|
|
5
|
+
- "iojs"
|
|
6
|
+
- "0.12"
|
|
7
|
+
- "0.10"
|
|
8
|
+
script:
|
|
9
|
+
- "npm run test-travis"
|
|
10
|
+
after_script:
|
|
11
|
+
- "npm install coveralls@2 && cat coverage/lcov.info | coveralls"
|
|
12
|
+
matrix:
|
|
13
|
+
fast_finish: true
|
|
14
|
+
notifications:
|
|
15
|
+
irc:
|
|
16
|
+
channels:
|
|
17
|
+
- "irc.freenode.org#unshift"
|
|
18
|
+
on_success: change
|
|
19
|
+
on_failure: change
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Unshift.io, Arnout Kazemier, the Contributors.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# requires-port
|
|
2
|
+
|
|
3
|
+
[](http://unshift.io)[](http://browsenpm.org/package/requires-port)[](https://travis-ci.org/unshiftio/requires-port)[](https://david-dm.org/unshiftio/requires-port)[](https://coveralls.io/r/unshiftio/requires-port?branch=master)[](http://webchat.freenode.net/?channels=unshift)
|
|
4
|
+
|
|
5
|
+
The module name says it all, check if a protocol requires a given port.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
This module is intended to be used with browserify or Node.js and is distributed
|
|
10
|
+
in the public npm registry. To install it simply run the following command from
|
|
11
|
+
your CLI:
|
|
12
|
+
|
|
13
|
+
```j
|
|
14
|
+
npm install --save requires-port
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
The module exports it self as function and requires 2 arguments:
|
|
20
|
+
|
|
21
|
+
1. The port number, can be a string or number.
|
|
22
|
+
2. Protocol, can be `http`, `http:` or even `https://yomoma.com`. We just split
|
|
23
|
+
it at `:` and use the first result. We currently accept the following
|
|
24
|
+
protocols:
|
|
25
|
+
- `http`
|
|
26
|
+
- `https`
|
|
27
|
+
- `ws`
|
|
28
|
+
- `wss`
|
|
29
|
+
- `ftp`
|
|
30
|
+
- `gopher`
|
|
31
|
+
- `file`
|
|
32
|
+
|
|
33
|
+
It returns a boolean that indicates if protocol requires this port to be added
|
|
34
|
+
to your URL.
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
'use strict';
|
|
38
|
+
|
|
39
|
+
var required = require('requires-port');
|
|
40
|
+
|
|
41
|
+
console.log(required('8080', 'http')) // true
|
|
42
|
+
console.log(required('80', 'http')) // false
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
# License
|
|
46
|
+
|
|
47
|
+
MIT
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Check if we're required to add a port number.
|
|
5
|
+
*
|
|
6
|
+
* @see https://url.spec.whatwg.org/#default-port
|
|
7
|
+
* @param {Number|String} port Port number we need to check
|
|
8
|
+
* @param {String} protocol Protocol we need to check against.
|
|
9
|
+
* @returns {Boolean} Is it a default port for the given protocol
|
|
10
|
+
* @api private
|
|
11
|
+
*/
|
|
12
|
+
module.exports = function required(port, protocol) {
|
|
13
|
+
protocol = protocol.split(':')[0];
|
|
14
|
+
port = +port;
|
|
15
|
+
|
|
16
|
+
if (!port) return false;
|
|
17
|
+
|
|
18
|
+
switch (protocol) {
|
|
19
|
+
case 'http':
|
|
20
|
+
case 'ws':
|
|
21
|
+
return port !== 80;
|
|
22
|
+
|
|
23
|
+
case 'https':
|
|
24
|
+
case 'wss':
|
|
25
|
+
return port !== 443;
|
|
26
|
+
|
|
27
|
+
case 'ftp':
|
|
28
|
+
return port !== 21;
|
|
29
|
+
|
|
30
|
+
case 'gopher':
|
|
31
|
+
return port !== 70;
|
|
32
|
+
|
|
33
|
+
case 'file':
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return port !== 0;
|
|
38
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "requires-port",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Check if a protocol requires a certain port number to be added to an URL.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
|
|
8
|
+
"test-travis": "istanbul cover _mocha --report lcovonly -- test.js",
|
|
9
|
+
"coverage": "istanbul cover _mocha -- test.js",
|
|
10
|
+
"watch": "mocha --watch test.js",
|
|
11
|
+
"test": "mocha test.js"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/unshiftio/requires-port"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"port",
|
|
19
|
+
"require",
|
|
20
|
+
"http",
|
|
21
|
+
"https",
|
|
22
|
+
"ws",
|
|
23
|
+
"wss",
|
|
24
|
+
"gopher",
|
|
25
|
+
"file",
|
|
26
|
+
"ftp",
|
|
27
|
+
"requires",
|
|
28
|
+
"requried",
|
|
29
|
+
"portnumber",
|
|
30
|
+
"url",
|
|
31
|
+
"parsing",
|
|
32
|
+
"validation",
|
|
33
|
+
"cows"
|
|
34
|
+
],
|
|
35
|
+
"author": "Arnout Kazemier",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/unshiftio/requires-port/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/unshiftio/requires-port",
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"assume": "1.3.x",
|
|
43
|
+
"istanbul": "0.4.x",
|
|
44
|
+
"mocha": "2.3.x",
|
|
45
|
+
"pre-commit": "1.1.x"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
describe('requires-port', function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var assume = require('assume')
|
|
5
|
+
, required = require('./');
|
|
6
|
+
|
|
7
|
+
it('is exported as a function', function () {
|
|
8
|
+
assume(required).is.a('function');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('does not require empty ports', function () {
|
|
12
|
+
assume(required('', 'http')).false();
|
|
13
|
+
assume(required('', 'wss')).false();
|
|
14
|
+
assume(required('', 'ws')).false();
|
|
15
|
+
assume(required('', 'cowsack')).false();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('assumes true for unknown protocols',function () {
|
|
19
|
+
assume(required('808', 'foo')).true();
|
|
20
|
+
assume(required('80', 'bar')).true();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('never requires port numbers for file', function () {
|
|
24
|
+
assume(required(8080, 'file')).false();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('does not require port 80 for http', function () {
|
|
28
|
+
assume(required('80', 'http')).false();
|
|
29
|
+
assume(required(80, 'http')).false();
|
|
30
|
+
assume(required(80, 'http://')).false();
|
|
31
|
+
assume(required(80, 'http://www.google.com')).false();
|
|
32
|
+
|
|
33
|
+
assume(required('8080', 'http')).true();
|
|
34
|
+
assume(required(8080, 'http')).true();
|
|
35
|
+
assume(required(8080, 'http://')).true();
|
|
36
|
+
assume(required(8080, 'http://www.google.com')).true();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('does not require port 80 for ws', function () {
|
|
40
|
+
assume(required('80', 'ws')).false();
|
|
41
|
+
assume(required(80, 'ws')).false();
|
|
42
|
+
assume(required(80, 'ws://')).false();
|
|
43
|
+
assume(required(80, 'ws://www.google.com')).false();
|
|
44
|
+
|
|
45
|
+
assume(required('8080', 'ws')).true();
|
|
46
|
+
assume(required(8080, 'ws')).true();
|
|
47
|
+
assume(required(8080, 'ws://')).true();
|
|
48
|
+
assume(required(8080, 'ws://www.google.com')).true();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('does not require port 443 for https', function () {
|
|
52
|
+
assume(required('443', 'https')).false();
|
|
53
|
+
assume(required(443, 'https')).false();
|
|
54
|
+
assume(required(443, 'https://')).false();
|
|
55
|
+
assume(required(443, 'https://www.google.com')).false();
|
|
56
|
+
|
|
57
|
+
assume(required('8080', 'https')).true();
|
|
58
|
+
assume(required(8080, 'https')).true();
|
|
59
|
+
assume(required(8080, 'https://')).true();
|
|
60
|
+
assume(required(8080, 'https://www.google.com')).true();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('does not require port 443 for wss', function () {
|
|
64
|
+
assume(required('443', 'wss')).false();
|
|
65
|
+
assume(required(443, 'wss')).false();
|
|
66
|
+
assume(required(443, 'wss://')).false();
|
|
67
|
+
assume(required(443, 'wss://www.google.com')).false();
|
|
68
|
+
|
|
69
|
+
assume(required('8080', 'wss')).true();
|
|
70
|
+
assume(required(8080, 'wss')).true();
|
|
71
|
+
assume(required(8080, 'wss://')).true();
|
|
72
|
+
assume(required(8080, 'wss://www.google.com')).true();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('does not require port 21 for ftp', function () {
|
|
76
|
+
assume(required('21', 'ftp')).false();
|
|
77
|
+
assume(required(21, 'ftp')).false();
|
|
78
|
+
assume(required(21, 'ftp://')).false();
|
|
79
|
+
assume(required(21, 'ftp://www.google.com')).false();
|
|
80
|
+
|
|
81
|
+
assume(required('8080', 'ftp')).true();
|
|
82
|
+
assume(required(8080, 'ftp')).true();
|
|
83
|
+
assume(required(8080, 'ftp://')).true();
|
|
84
|
+
assume(required(8080, 'ftp://www.google.com')).true();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('does not require port 70 for gopher', function () {
|
|
88
|
+
assume(required('70', 'gopher')).false();
|
|
89
|
+
assume(required(70, 'gopher')).false();
|
|
90
|
+
assume(required(70, 'gopher://')).false();
|
|
91
|
+
assume(required(70, 'gopher://www.google.com')).false();
|
|
92
|
+
|
|
93
|
+
assume(required('8080', 'gopher')).true();
|
|
94
|
+
assume(required(8080, 'gopher')).true();
|
|
95
|
+
assume(required(8080, 'gopher://')).true();
|
|
96
|
+
assume(required(8080, 'gopher://www.google.com')).true();
|
|
97
|
+
});
|
|
98
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Feross Aboukhadijeh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|