Replace underscore _.clone with Object.assign.

This commit is contained in:
Jesse Rosenberger
2017-07-31 11:50:36 +03:00
parent 300511450b
commit 3cdcca6f6a

View File

@@ -19,7 +19,6 @@ import {
isLoggedIn,
maybePrintRegistrationLink,
} from './auth.js';
import { clone } from 'underscore';
import { recordPackages } from './stats.js';
import { Console } from '../console/console.js';
@@ -71,8 +70,8 @@ const CAPABILITIES = ['showDeployMessages', 'canTransferAuthorization'];
// body, or a generic 'try again later' message, as appropriate
function deployRpc(options) {
options = clone(options);
options.headers = clone(options.headers || {});
options = Object.assign({}, options);
options.headers = Object.assign({}, options.headers || {});
if (options.headers.cookie) {
throw new Error("sorry, can't combine cookie headers yet");
}
@@ -165,7 +164,7 @@ function deployRpc(options) {
// the user to log in with a username and password and then resend the
// RPC.
function authedRpc(options) {
var rpcOptions = clone(options);
var rpcOptions = Object.assign({}, options);
var preflight = rpcOptions.preflight;
delete rpcOptions.preflight;