koa-simple-ratelimit
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -67,7 +67,6 @@ 'use strict'; | ||
return find(opts.db, name).then((cur) => { | ||
const n = ~~cur; | ||
const ex = opts.duration || 3600000; | ||
const n = Math.floor(cur); | ||
let t = Date.now(); | ||
t += ex; | ||
t = new Date(t).getTime() / 1000 | 0; | ||
t += opts.duration || 3600000; | ||
t = new Date(t).getTime() / 1000 || 0; | ||
@@ -74,0 +73,0 @@ const headers = {}; |
{ | ||
"name": "koa-simple-ratelimit", | ||
"description": "Simple Rate limiter middleware for koa", | ||
"repository": "scttcper/koa-simple-ratelimit", | ||
"version": "2.0.0", | ||
"description": "Simple Rate limiter middleware for koa v2", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/scttcper/koa-simple-ratelimit.git" | ||
}, | ||
"version": "2.1.0", | ||
"keywords": [ | ||
@@ -21,9 +24,9 @@ "koa", | ||
"devDependencies": { | ||
"koa": "^2.0.0-beta.4", | ||
"mocha": "^3.0.1", | ||
"koa": "2.0.0-alpha.7", | ||
"mocha": "^3.0.2", | ||
"redis": "^2.6.2", | ||
"should": "^10.0.0", | ||
"eslint": "~3.2.2", | ||
"eslint-config-airbnb-base": "~5.0.1", | ||
"eslint-plugin-import": "~1.12.0", | ||
"should": "^11.1.0", | ||
"eslint": "~3.6.0", | ||
"eslint-config-airbnb-base": "~8.0.0", | ||
"eslint-plugin-import": "~1.16.0", | ||
"supertest": "^2.0.0" | ||
@@ -30,0 +33,0 @@ }, |
@@ -57,2 +57,4 @@ | ||
- `id` id to compare requests [ip] | ||
- `whitelist` array of ids to whitelist | ||
- `blacklist` array of ids to blacklist | ||
@@ -59,0 +61,0 @@ ## Responses |
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
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 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
7128
98
0
100