Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa-rewrite

Package Overview
Dependencies
Maintainers
9
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-rewrite - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

16

History.md
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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc