File tree Expand file tree Collapse file tree 5 files changed +1784
-3371
lines changed Expand file tree Collapse file tree 5 files changed +1784
-3371
lines changed Original file line number Diff line number Diff line change @@ -67,3 +67,5 @@ typings/
6767
6868# ignore production configuration
6969.env.production
70+
71+ .history /
Original file line number Diff line number Diff line change 1+ ## v7.1.2 (January 12, 2020)
2+
3+ - Added cross-env to solve windows envionment issues
4+ - Use Mongoose built in function to validate ID
5+ - NPM updated
6+
17## v7.1.1 (September 29, 2019)
28
39- Added new option MongoClient constructor
Original file line number Diff line number Diff line change 1+ const mongoose = require ( 'mongoose' )
12const requestIp = require ( 'request-ip' )
23const { validationResult } = require ( 'express-validator' )
34
@@ -96,7 +97,7 @@ exports.buildSuccObject = message => {
9697 */
9798exports . isIDGood = async id => {
9899 return new Promise ( ( resolve , reject ) => {
99- const goodID = String ( id ) . match ( / ^ [ 0 - 9 a - f A - F ] { 24 } $ / )
100+ const goodID = mongoose . Types . ObjectId . isValid ( id )
100101 return goodID
101102 ? resolve ( id )
102103 : reject ( this . buildErrObject ( 422 , 'ID_MALFORMED' ) )
You can’t perform that action at this time.
0 commit comments