New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adonisjs/framework

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/framework - npm Package Compare versions

Comparing version 5.0.9 to 5.0.11

2

.github/PULL_REQUEST_TEMPLATE.md

@@ -21,3 +21,3 @@ <!-- CLICK "Preview" FOR INSTRUCTIONS IN A MORE READABLE FORMAT -->

- [ ] I have read the [CONTRIBUTING](https://github.com/adonisjs/adonis-framework/CONTRIBUTING.md) doc
- [ ] I have read the [CONTRIBUTING](https://github.com/adonisjs/adonis-framework/blob/develop/CONTRIBUTING.md) doc
- [ ] Lint and unit tests pass locally with my changes

@@ -24,0 +24,0 @@ - [ ] I have added tests that prove my fix is effective or that my feature works.

@@ -0,1 +1,21 @@

<a name="5.0.11"></a>
## [5.0.11](https://github.com/adonisjs/adonis-framework/compare/v5.0.10...v5.0.11) (2018-10-16)
### Bug Fixes
* **request:** re-compute request.all when qs updates ([61a4a36](https://github.com/adonisjs/adonis-framework/commit/61a4a36))
### Features
* **request:** add request.original to access the original request data ([2d12926](https://github.com/adonisjs/adonis-framework/commit/2d12926))
<a name="5.0.10"></a>
## [5.0.10](https://github.com/adonisjs/adonis-framework/compare/v5.0.9...v5.0.10) (2018-10-01)
<a name="5.0.9"></a>

@@ -2,0 +22,0 @@ ## [5.0.9](https://github.com/adonisjs/adonis-framework/compare/v5.0.8...v5.0.9) (2018-09-27)

# The MIT License
Copyright 2018 thetutlage, contributors
Copyright 2018 Harminder Virk, contributors

@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

{
"name": "@adonisjs/framework",
"version": "5.0.9",
"version": "5.0.11",
"description": "Adonis framework makes it easy for you to write webapps with less code",

@@ -10,4 +10,3 @@ "main": "index.js",

"test:local": "FORCE_COLOR=true node bin/index.js --local",
"test": "npm run test:win",
"test:win": "node japaFile.js",
"test": "nyc node japaFile.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",

@@ -31,7 +30,7 @@ "commit": "git-cz",

"@adonisjs/fold": "^4.0.9",
"@adonisjs/mrm-preset": "^1.0.11",
"@adonisjs/mrm-preset": "^1.0.14",
"@adonisjs/sink": "^1.0.17",
"argon2": "^0.19.3",
"clear-require": "^2.0.0",
"commitizen": "^2.10.1",
"commitizen": "^3.0.2",
"cookie-signature": "^1.1.0",

@@ -41,8 +40,8 @@ "coveralls": "^3.0.2",

"fs-extra": "^7.0.0",
"japa": "^2.0.3",
"japa": "^2.0.5",
"mrm": "^1.2.1",
"nyc": "^13.0.1",
"nyc": "^13.1.0",
"pify": "^4.0.0",
"pkg-ok": "^2.2.0",
"semver": "^5.5.1",
"pkg-ok": "^2.3.1",
"semver": "^5.6.0",
"standard": "^12.0.1",

@@ -57,4 +56,4 @@ "supertest": "^3.3.0",

"co-compose": "^4.0.0",
"debug": "^4.0.1",
"dotenv": "^6.0.0",
"debug": "^4.1.0",
"dotenv": "^6.1.0",
"edge.js": "^1.1.4",

@@ -77,3 +76,3 @@ "eventemitter2": "^5.0.1",

"winston": "^3.1.0",
"youch": "^2.0.9"
"youch": "^2.0.10"
},

@@ -86,4 +85,3 @@ "nyc": {

"exclude": [
"test",
"japaFile.js"
"test"
]

@@ -90,0 +88,0 @@ },

@@ -15,3 +15,3 @@ # Adonis Framework :triangular_ruler:

<img src="http://res.cloudinary.com/adonisjs/image/upload/q_100/v1497112678/adonis-purple_pzkmzt.svg" width="200px" align="right" hspace="30px" vspace="140px">
<img src="https://res.cloudinary.com/adonisjs/image/upload/q_100/v1497112678/adonis-purple_pzkmzt.svg" width="200px" align="right" hspace="30px" vspace="140px">

@@ -103,2 +103,2 @@ ## What's in the box?

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fadonisjs%2Fadonis-framework.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fadonisjs%2Fadonis-framework?ref=badge_large)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fadonisjs%2Fadonis-framework.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fadonisjs%2Fadonis-framework?ref=badge_large)

@@ -33,2 +33,3 @@ 'use strict'

const Macroable = require('macroable')
const debug = require('debug')('adonis:request')

@@ -93,3 +94,3 @@ const SUBDOMAIN_OFFSET = 'app.http.subdomainOffset'

*/
this._qs = nodeReq.get(this.request)
this._qs = null

@@ -111,7 +112,21 @@ /**

/**
* A merged object of get and post
* A merged object of get and post. This will re-computed everytime we will
* update the `qs` or `body` properties on this class.
*
* @type {Object}
*/
this._all = _.merge({}, this.get())
this._all = null
/**
* A reference to the original request object. The object will be freezed for further
* modifications once computed
*
* @type {Object}
*/
this._original = {}
/**
* Set qs by parsing the request. `this._all` will be computed out of it
*/
this.qs = nodeReq.get(this.request)
}

@@ -141,7 +156,82 @@

set body (body) {
debug('updated request body')
const hasBody = !!this._body
this._body = body
this._all = _.merge({}, this.get(), body)
if (!hasBody) {
this._updateRequestOriginal()
}
}
/**
* Returns the query string as an object
*
* @method qs
*
* @return {Objec}
*/
get qs () {
return this._qs || {}
}
/**
* Update the query string. This will re-compute the
* _all
*
* @method qs
*
* @param {Object} qs
*
* @return {void}
*/
set qs (qs) {
debug('updated request query string')
const hasQs = !!this._qs
this._qs = qs
this._all = _.merge({}, this.post(), qs)
if (!hasQs) {
this._updateRequestOriginal()
}
}
/**
* Updates the request original payload by tracking the
* amount of mutations made to it. Once `qs` and `body`
* is set for the first time, after that original
* object will be freexed
*
* @method _updateRequestOriginal
*
* @return {void}
*
* @private
*/
_updateRequestOriginal () {
if (Object.isFrozen(this._original)) {
return
}
/**
* Update original value
*/
debug('updated request original data')
this._original = _.merge({}, this._all)
/**
* Once qs and body is stable, we will freeze the original
* object. This is important, since the original request
* body is mutable, however a reference to original is
* must
*/
if (this._qs && this._body) {
debug('freezing request original data')
Object.freeze(this._original)
}
}
/**
* Returns a boolean indicating if user is a bad safari.

@@ -177,3 +267,3 @@ * This method is used by the `fresh` method to address

get () {
return this._qs
return this.qs
}

@@ -204,2 +294,15 @@

/**
* Similar to `request.all`, but later mutations are avoided. Use this
* method, when you want to read the values submitted in the original
* HTTP request.
*
* @method original
*
* @return {Object}
*/
original () {
return this._original
}
/**
* Returns an object after merging {{#crossLink "Request/get"}}{{/crossLink}} and

@@ -206,0 +309,0 @@ * {{#crossLink "Request/post"}}{{/crossLink}} values

Sorry, the diff of this file is not supported yet

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