vpndetection-web 1.3.0 → 1.3.1

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/README.md CHANGED
@@ -7,10 +7,10 @@ The official browser client library for the [VPNDetection](https://vpndetection.
7
7
 
8
8
  It tells you whether an IP address is a VPN, residential proxy, Tor node, relay or hosting server.
9
9
 
10
- **An API key in a web page is public.** Anyone who opens the page can read it from the page's source or its network requests, and spend your allowance with it. In a page, use no key, or call the API from your own server and hand the page its answer. A key belongs only where the person it belongs to is the only one who can read it: their own browser extension, or an internal tool.
11
-
12
10
  ## Getting Started
13
11
 
12
+ **An API key in a web page is public.** Anyone who opens the page can read it from the page's source or its network requests and use it as you would: spend your plan's lookups and, if the key may download databases, download every database your organization is licensed for. In a page, use no key, or call the API from your own server and hand the page its answer. A key belongs only where the person it belongs to is the only one who can read it, such as their own browser extension or an internal tool, and there a key that may only look up.
13
+
14
14
  ```bash
15
15
  npm install vpndetection-web
16
16
  ```
@@ -34,7 +34,7 @@ export declare function checkTimeout(timeoutMs: number | undefined): number | un
34
34
  */
35
35
  export declare function checkRetries(retries: number | null | undefined): number | undefined;
36
36
  /** How many batch requests may be in flight, refused where it is set: p-limit throws a bare TypeError. */
37
- export declare function checkConcurrency(concurrency: number | undefined): number | undefined;
37
+ export declare function checkConcurrency(concurrency: number | null | undefined): number | undefined;
38
38
  /**
39
39
  * Bound one attempt, and report an expiry as our own error rather than the
40
40
  * runtime's `TimeoutError`, whose message says nothing about which call gave up.
package/dist/transport.js CHANGED
@@ -69,7 +69,10 @@ export function checkRetries(retries) {
69
69
  }
70
70
  /** How many batch requests may be in flight, refused where it is set: p-limit throws a bare TypeError. */
71
71
  export function checkConcurrency(concurrency) {
72
- if (concurrency !== undefined && !(typeof concurrency === 'number' && concurrency >= 1
72
+ if (concurrency === undefined || concurrency === null) {
73
+ return undefined;
74
+ }
75
+ if (!(typeof concurrency === 'number' && concurrency >= 1
73
76
  && (Number.isInteger(concurrency) || concurrency === Infinity))) {
74
77
  throw new VPNDetectionError('bad_request', `concurrency must be a whole number of at least 1, got ${String(concurrency)}`);
75
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpndetection-web",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Official browser client library for the VPNDetection API. Detect VPNs, proxies, Tor, hosting and CDN IPs.",
5
5
  "type": "module",
6
6
  "license": "MIT",