connect-body-rewrite
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,4 +0,5 @@ | ||
module.exports = function(grunt) { | ||
module.exports = function (grunt) { | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('grunt-mocha-cli'); | ||
grunt.loadNpmTasks('grunt-release'); | ||
@@ -8,3 +9,3 @@ | ||
jshint: { | ||
all: ['index.js'], | ||
all: ['index.js', 'Gruntfile.js', 'test/**.js'], | ||
options: { | ||
@@ -16,12 +17,27 @@ jshintrc: '.jshintrc' | ||
watch: { | ||
options: { | ||
atBegin: true | ||
}, | ||
all: { | ||
files: ['index.js'], | ||
tasks: ['build'] | ||
files: ['index.js', 'test/**.js'], | ||
tasks: ['test'] | ||
} | ||
}, | ||
mochacli: { | ||
spec: { | ||
options: { | ||
files: 'test/**.js', | ||
reporter: 'spec', | ||
slow: 2000, | ||
timeout: 10000, | ||
} | ||
} | ||
} | ||
}); | ||
grunt.registerTask('default', ['build']); | ||
grunt.registerTask('default', ['test']); | ||
grunt.registerTask('build', ['jshint']); | ||
grunt.registerTask('package', ['build', 'release']); | ||
grunt.registerTask('test', ['build', 'mochacli']); | ||
}; |
@@ -74,6 +74,4 @@ 'use strict'; | ||
if (buffers[uid][res._rewriteId]) { | ||
if (buffers[uid][res._rewriteId] && options.accept(res)) { | ||
string = buffers[uid][res._rewriteId].buffer.join(''); | ||
delete buffers[uid][res._rewriteId]; | ||
string = options.rewrite(string); | ||
@@ -83,2 +81,4 @@ | ||
sendHeaders(); | ||
delete buffers[uid][res._rewriteId]; | ||
} | ||
@@ -85,0 +85,0 @@ |
{ | ||
"name": "connect-body-rewrite", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Rewrite request bodies.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "grunt build" | ||
"test": "grunt test" | ||
}, | ||
@@ -20,6 +20,9 @@ "keywords": [ | ||
"devDependencies": { | ||
"express": "~3.4.4", | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-jshint": "~0.7.1", | ||
"grunt-contrib-watch": "~0.5.3", | ||
"grunt-mocha-cli": "~1.3.0", | ||
"grunt-release": "~0.6.0", | ||
"grunt-contrib-watch": "~0.5.3", | ||
"grunt-contrib-jshint": "~0.7.1" | ||
"supertest": "~0.8.1" | ||
}, | ||
@@ -26,0 +29,0 @@ "homepage": "https://github.com/rubenv/connect-body-rewrite", |
@@ -5,2 +5,4 @@ # connect-body-rewrite - middleware to rewrite response bodies. | ||
[![Build Status](https://travis-ci.org/rubenv/connect-body-rewrite.png?branch=master)](https://travis-ci.org/rubenv/connect-body-rewrite) | ||
This plugin allows you to write middleware methods that process the response | ||
@@ -7,0 +9,0 @@ body of a call. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
12916
12
289
63
7
1