Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fs: copyObject() had unused argument: target
The fs function copyObject() had two arguments:
source and target. On the first line of the function it
assigned the target variable to:
arguments.length >= 2 ? target : {};

The function copyObject() was not called directly by
any test, but it is called in other fs functions. When it
was called it was only ever called with a single argument,
source. Thus I have removed the target argument and assigned
it to an empty object like it was being assigned to in the
original ternary operator.
  • Loading branch information
Ethan-Arrowood committed Dec 1, 2016
commit 92a4bb8c152328fa7a9fc95b38c1e8853c4d2f4b
4 changes: 2 additions & 2 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ function getOptions(options, defaultOptions) {
return options;
}

function copyObject(source, target) {
target = arguments.length >= 2 ? target : {};
function copyObject(source) {
const target = {};
for (const key in source)
target[key] = source[key];
return target;
Expand Down