koa-rewrite
Advanced tools
Comparing version 1.1.1 to 1.1.2
1.1.1 / 2015-10-21 | ||
1.1.2 / 2017-08-21 | ||
================== | ||
* Restore this.path when upstream | ||
- Technically a breaking change, however the lack fo this was actually a bug. Semver doesn't really work. | ||
**others** | ||
* [[`0165103`](http://github.com/koajs/rewrite/commit/01651037d17ba0e9c171d802d53b9f21ff8f7291)] - chore: set publish tag to v1 (dead-horse <<dead_horse@qq.com>>) | ||
1.1.1 / 2017-08-21 | ||
================== | ||
**others** | ||
* [[`9abc2fe`](http://github.com/koajs/rewrite/commit/9abc2fe4a366de97c1fec21ea16400d572fae728)] - refactor: use yield instead of yield* (#16) (fengmk2 <<fengmk2@gmail.com>>) | ||
* [[`37efdad`](http://github.com/koajs/rewrite/commit/37efdadc1790110d2f211fdac81eb0a7c72540f9)] - chore(package): update dependencies (greenkeeperio-bot <<support@greenkeeper.io>>) | ||
* [[`f2a27e8`](http://github.com/koajs/rewrite/commit/f2a27e8e15771629a03b961f668e1fd78fbd8ff2)] - add test (nswbmw1992 <<nswbmw1992@gmail.com>>) | ||
* [[`a5ef722`](http://github.com/koajs/rewrite/commit/a5ef7227089299eb1fbdbd42ff7db92185ca6f13)] - Restore this.path when upstream (nswbmw1992 <<nswbmw1992@gmail.com>>) | ||
* [[`1fdf5aa`](http://github.com/koajs/rewrite/commit/1fdf5aabfca39727c57cc0a64d1a89877d7759f1)] - Create .travis.yml (Jonathan Ong <<jonathanrichardong@gmail.com>>) | ||
1.1.0 / 2014-01-14 | ||
@@ -9,0 +19,0 @@ ================== |
25
index.js
@@ -0,13 +1,6 @@ | ||
'use strict'; | ||
/** | ||
* Module dependencies. | ||
*/ | ||
var debug = require('debug')('koa-rewrite'); | ||
var toRegexp = require('path-to-regexp'); | ||
var debug = require('debug')('koa-rewrite'); | ||
var toRegexp = require('path-to-regexp'); | ||
/** | ||
* Expose `expose`. | ||
*/ | ||
module.exports = rewrite; | ||
@@ -31,8 +24,8 @@ | ||
return function*(next){ | ||
return function* (next) { | ||
var orig = this.path; | ||
var m = re.exec(orig); | ||
if (m) { | ||
this.path = dst.replace(/\$(\d+)|(?::(\w+))/g, function(_, n, name){ | ||
this.path = dst.replace(/\$(\d+)|(?::(\w+))/g, function(_, n, name) { | ||
if (name) return m[map[name].index + 1]; | ||
@@ -44,3 +37,3 @@ return m[n]; | ||
yield* next; | ||
yield next; | ||
@@ -51,3 +44,3 @@ this.path = orig; | ||
yield* next; | ||
yield next; | ||
} | ||
@@ -73,2 +66,2 @@ } | ||
return map; | ||
} | ||
} |
@@ -5,5 +5,5 @@ { | ||
"repository": "koajs/rewrite", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"scripts": { | ||
"test": "./node_modules/mocha/bin/mocha --harmony test/test" | ||
"test": "mocha --harmony test/*.js" | ||
}, | ||
@@ -20,12 +20,15 @@ "keywords": [ | ||
], | ||
"publishConfig": { | ||
"tag": "v1" | ||
}, | ||
"devDependencies": { | ||
"koa": "~0.2.1", | ||
"mocha": "^2.2.4", | ||
"supertest": "^0.15.0" | ||
"koa": "1", | ||
"mocha": "2", | ||
"supertest": "1" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"debug": "*", | ||
"path-to-regexp": "0.0.2" | ||
"debug": "^3.0.0", | ||
"path-to-regexp": "^1.7.0" | ||
} | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
# koa-rewrite | ||
@@ -48,2 +47,2 @@ | ||
MIT | ||
MIT |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
3759
0
48
1
+ Addeddebug@3.2.7(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedpath-to-regexp@1.9.0(transitive)
- Removeddebug@4.4.0(transitive)
- Removedpath-to-regexp@0.0.2(transitive)
Updateddebug@^3.0.0
Updatedpath-to-regexp@^1.7.0