Comparing version 1.1.0 to 1.2.0
@@ -6,2 +6,6 @@ # Change log | ||
## 1.2.0 - 2016-08-04 | ||
- Feature: add .none() for accepting only fields | ||
## 1.1.0 - 2015-10-23 | ||
@@ -8,0 +12,0 @@ |
@@ -69,2 +69,6 @@ var makeError = require('./lib/make-error') | ||
Multer.prototype.none = function () { | ||
return this._makeMiddleware([], 'NONE') | ||
} | ||
Multer.prototype.any = function () { | ||
@@ -71,0 +75,0 @@ function setup () { |
@@ -13,2 +13,3 @@ var objectAssign = require('object-assign') | ||
switch (strategy) { | ||
case 'NONE': break | ||
case 'VALUE': break | ||
@@ -27,2 +28,3 @@ case 'ARRAY': req.files = []; break | ||
switch (this.strategy) { | ||
case 'NONE': break | ||
case 'VALUE': break | ||
@@ -44,2 +46,3 @@ case 'ARRAY': this.req.files.push(placeholder); break | ||
switch (this.strategy) { | ||
case 'NONE': break | ||
case 'VALUE': break | ||
@@ -46,0 +49,0 @@ case 'ARRAY': arrayRemove(this.req.files, placeholder); break |
{ | ||
"name": "multer", | ||
"description": "Middleware for handling `multipart/form-data`.", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"contributors": [ | ||
@@ -6,0 +6,0 @@ "Hage Yaapa <captain@hacksparrow.com> (http://www.hacksparrow.com)", |
@@ -134,2 +134,7 @@ # Multer [![Build Status](https://travis-ci.org/expressjs/multer.svg?branch=master)](https://travis-ci.org/expressjs/multer) [![NPM version](https://badge.fury.io/js/multer.svg)](https://badge.fury.io/js/multer) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) | ||
#### `.none()` | ||
Accept only text fields. If any file upload is made, error with code | ||
"LIMIT\_UNEXPECTED\_FILE" will be issued. This is the same as doing `upload.fields([])`. | ||
#### `.any()` | ||
@@ -136,0 +141,0 @@ |
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
25298
405
282