limited-request-queue
Advanced tools
Comparing version 3.0.2 to 3.0.4
"use strict"; | ||
var defaultOptions = | ||
{ | ||
defaultPorts: {ftp:21, http:80, https:443}, | ||
defaultPorts: {ftp:21, http:80, https:443}, // TODO :: empty this when removing node.js url support | ||
ignorePorts: true, | ||
@@ -6,0 +6,0 @@ ignoreSchemes: true, |
"use strict"; | ||
var isBrowser = require("is-browser"); | ||
var broquire = require("broquire")(require); | ||
var isString = require("is-string"); | ||
var parseDomain,_require,URL; | ||
var parseDomain = broquire("parse-domain", function(){ return null }); | ||
var URL = broquire("whatwg-url", "window").URL; | ||
if (isBrowser === true) | ||
{ | ||
parseDomain = function(){ return null }; | ||
URL = window.URL; | ||
} | ||
else | ||
{ | ||
// Avoid including libs with browserify | ||
_require = eval("require"); | ||
parseDomain = _require("parse-domain"); | ||
URL = _require("whatwg-url").URL; | ||
} | ||
function getHostKey(url, options) | ||
@@ -27,4 +13,8 @@ { | ||
if (isString(url) === true) | ||
if (url == null) | ||
{ | ||
return false; | ||
} | ||
else if (isString(url) === true) | ||
{ | ||
try | ||
@@ -42,2 +32,3 @@ { | ||
// TODO :: remove support for node-js url.parse objects | ||
if (isEmptyString(protocol)===true || isEmptyString(url.hostname)===true) | ||
@@ -57,2 +48,3 @@ { | ||
// Get default port | ||
// TODO :: remove support for node-js url.parse objects | ||
if (isEmptyStringOrNumber(port)===true && options.defaultPorts[protocol]!==undefined) | ||
@@ -59,0 +51,0 @@ { |
@@ -47,3 +47,3 @@ "use strict"; | ||
// enqueue("url") | ||
if (isString(input) === true) | ||
if (input==null || isString(input)===true) | ||
{ | ||
@@ -50,0 +50,0 @@ input = { url:input }; |
{ | ||
"name": "limited-request-queue", | ||
"description": "Interactively manage concurrency for outbound requests.", | ||
"version": "3.0.2", | ||
"version": "3.0.4", | ||
"license": "MIT", | ||
"homepage": "https://github.com/stevenvachon/limited-request-queue", | ||
"author": { | ||
"name": "Steven Vachon", | ||
"email": "contact@svachon.com", | ||
"url": "http://www.svachon.com/" | ||
}, | ||
"author": "Steven Vachon <contact@svachon.com> (https://www.svachon.com/)", | ||
"main": "lib", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/stevenvachon/limited-request-queue.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/stevenvachon/limited-request-queue/issues" | ||
}, | ||
"repository": "stevenvachon/limited-request-queue", | ||
"dependencies": { | ||
"is-browser": "^2.0.1", | ||
"broquire": "^1.0.0", | ||
"is-string": "^1.0.4", | ||
@@ -32,4 +21,4 @@ "parse-domain": "~0.2.1", | ||
"object.assign": "^4.0.4", | ||
"phantomjs-prebuilt": "^2.1.11", | ||
"uglify-js": "^2.7.0" | ||
"phantomjs-prebuilt": "^2.1.12", | ||
"uglify-js": "^2.7.3" | ||
}, | ||
@@ -36,0 +25,0 @@ "engines": { |
@@ -57,7 +57,7 @@ # limited-request-queue [![NPM Version][npm-image]][npm-url] [![Bower Version][bower-image]][bower-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][david-image]][david-url] | ||
### `.enqueue(input)` | ||
Adds a URL to the queue. `input` can either be a URL `String` or a [`URL`](https://developer.mozilla.org/en/docs/Web/API/URL/)-compatible `Object`. Returns a queue ID on success or an `Error` on failure. | ||
Adds a URL to the queue. `input` can either be a URL `String` or a configuration `Object`. Returns a queue ID on success or an `Error` on failure. | ||
If `input` is an `Object`, it will acccept the following keys: | ||
If `input` is an `Object`, it will accept the following keys: | ||
* `url`: a URL `String` or `URL`-compatible `Object`. | ||
* `url`: a URL `String`, [`URL`](https://developer.mozilla.org/en/docs/Web/API/URL/) or [Node URL](https://nodejs.org/api/url.html#url_url_strings_and_url_objects)-compatible `Object`. | ||
* `data`: additional data to be stored in the queue item. | ||
@@ -64,0 +64,0 @@ * `id`: a unique ID (`String` or `Number`). If not defined, one will be generated. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
0
14163
282
2
1
1
+ Addedbroquire@^1.0.0
+ Addedbroquire@1.0.0(transitive)
- Removedis-browser@^2.0.1