Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f199e94

Browse filesBrowse files
committed
perf: remove unnecessary object clone
1 parent 0123e12 commit f199e94
Copy full SHA for f199e94

File tree

Expand file treeCollapse file tree

2 files changed

+9
-9
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-9
lines changed

‎HISTORY.md

Copy file name to clipboardExpand all lines: HISTORY.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ unreleased
22
==========
33

44
* deps: qs@6.11.0
5+
* perf: remove unnecessary object clone
56

67
1.20.0 / 2022-04-02
78
===================

‎index.js

Copy file name to clipboardExpand all lines: index.js
+8-9Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,15 @@ Object.defineProperty(exports, 'urlencoded', {
9191
*/
9292

9393
function bodyParser (options) {
94-
var opts = {}
95-
96-
// exclude type option
97-
if (options) {
98-
for (var prop in options) {
99-
if (prop !== 'type') {
100-
opts[prop] = options[prop]
101-
}
94+
// use default type for parsers
95+
var opts = Object.create(options || null, {
96+
type: {
97+
configurable: true,
98+
enumerable: true,
99+
value: undefined,
100+
writable: true
102101
}
103-
}
102+
})
104103

105104
var _urlencoded = exports.urlencoded(opts)
106105
var _json = exports.json(opts)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.