Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Revert "Remove lodash dependency"
Browse files Browse the repository at this point in the history
This reverts commit a38efb7.

Not sure how to get this to work: getting "TypeError: Cannot assign to read only property for all methods" when running with this commit.  Will revert back for now.
  • Loading branch information
exdx committed Feb 11, 2019
1 parent d478542 commit b339932
Show file tree
Hide file tree
Showing 35 changed files with 530 additions and 404 deletions.
3 changes: 2 additions & 1 deletion lib/jobs/artifactsDestroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -37,7 +38,7 @@ function artifactsDestroy(params, cb) {
return method(artifactsDestroy, params, cb);
}

Object.assign(artifactsDestroy, {
assign(artifactsDestroy, {
auth: true,
group: 'jobs',
name: 'artifactsDestroy',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/artifactsGet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');
var AWS = require('aws-sdk');
var fs = require('fs');
var path = require('path');
Expand Down Expand Up @@ -215,7 +216,7 @@ function artifactsGet(params, cb) {
});
}

Object.assign(artifactsGet, {
assign(artifactsGet, {
auth: true,
group: 'jobs',
name: 'artifactsGet',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/artifactsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -68,7 +69,7 @@ function artifactsList(params, cb) {
});
}

Object.assign(artifactsList, {
assign(artifactsList, {
auth: true,
group: 'jobs',
name: 'artifactsList',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -65,7 +66,7 @@ function clone(params, cb) {
});
}

Object.assign(clone, {
assign(clone, {
auth: true,
group: 'jobs',
name: 'clone',
Expand Down
5 changes: 3 additions & 2 deletions lib/jobs/create.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');
var path = require('path');
var mkdirp = require('mkdirp');
var async = require('async');
Expand Down Expand Up @@ -501,7 +502,7 @@ function create(params, cb) {
// if link pass in workspaceFileName param for jobs service to download it when running the job
if (params.workspace.startsWith('https://') || params.workspace.startsWith('git+https://')) params.workspaceFileName = params.workspace;

// don't try to upload it; we normally attempt to upload anything in the workspace param specified in Object.assign() below
// don't try to upload it; we normally attempt to upload anything in the workspace param specified in assign() below
delete params.workspace;
return method(create, params, function _methodCb(err, res) {
if (err) return cb(err);
Expand All @@ -517,7 +518,7 @@ function getFilesizeInBytes(filename) {
return fileSizeInBytes;
}

Object.assign(create, {
assign(create, {
auth: true,
group: 'jobs',
name: 'create',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -38,7 +39,7 @@ function destroy(params, cb) {
});
}

Object.assign(destroy, {
assign(destroy, {
auth: true,
group: 'jobs',
name: 'destroy',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');
var path = require('path');
var Table = require('table');

Expand Down Expand Up @@ -144,7 +145,7 @@ function list(params, cb) {
});
}

Object.assign(list, {
assign(list, {
auth: true,
group: 'jobs',
name: 'list',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -131,7 +132,7 @@ function logs(params, cb) {
}


Object.assign(logs, {
assign(logs, {
auth: true,
group: 'jobs',
name: 'logs',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/machineTypes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -65,7 +66,7 @@ function machineTypes(params, cb) {
return method(machineTypes, params, cb);
}

Object.assign(machineTypes, {
assign(machineTypes, {
auth: true,
group: 'jobs',
name: 'machineTypes',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -63,7 +64,7 @@ function show(params, cb) {
return method(show, params, cb);
}

Object.assign(show, {
assign(show, {
auth: true,
group: 'jobs',
name: 'show',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/stop.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -32,7 +33,7 @@ function stop(params, cb) {
return method(stop, params, cb);
}

Object.assign(stop, {
assign(stop, {
auth: true,
group: 'jobs',
name: 'stop',
Expand Down
3 changes: 2 additions & 1 deletion lib/jobs/waitfor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var method = require('./../method');
var projectConfig = require('./../projectConfig');
var assign = require('lodash.assign');

/**
* @memberof jobs
Expand Down Expand Up @@ -114,7 +115,7 @@ function waitfor(params, cb) {
});
}

Object.assign(waitfor, {
assign(waitfor, {
auth: true,
group: 'jobs',
name: 'waitfor',
Expand Down
5 changes: 3 additions & 2 deletions lib/login/user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');
var userConfig = require('./../userConfig');

const UNAUTHORIZED_EXTENDED_INFO = "\n\nNote: Please keep in mind that currently you can login only with the email and password " +
Expand Down Expand Up @@ -61,7 +62,7 @@ function user(params, cb) {
});
}

Object.assign(user, {
assign(user, {
auth: true,
group: 'login',
name: 'user',
Expand All @@ -71,4 +72,4 @@ Object.assign(user, {
returns: {},
});

module.exports = user;
module.exports = user;
3 changes: 2 additions & 1 deletion lib/machines/availability.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -39,7 +40,7 @@ function availability(params, cb) {
return method(availability, params, cb);
}

Object.assign(availability, {
assign(availability, {
auth: true,
group: 'machines',
name: 'availability',
Expand Down
3 changes: 2 additions & 1 deletion lib/machines/create.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -122,7 +123,7 @@ function create(params, cb) {
return method(create, params, cb);
}

Object.assign(create, {
assign(create, {
auth: true,
group: 'machines',
name: 'create',
Expand Down
3 changes: 2 additions & 1 deletion lib/machines/destroy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -35,7 +36,7 @@ function destroy(params, cb) {
return method(destroy, params, cb);
}

Object.assign(destroy, {
assign(destroy, {
auth: true,
group: 'machines',
name: 'destroy',
Expand Down
3 changes: 2 additions & 1 deletion lib/machines/list.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -87,7 +88,7 @@ function list(params, cb) {
return method(list, params, cb);
}

Object.assign(list, {
assign(list, {
auth: true,
group: 'machines',
name: 'list',
Expand Down
3 changes: 2 additions & 1 deletion lib/machines/restart.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -31,7 +32,7 @@ function restart(params, cb) {
return method(restart, params, cb);
}

Object.assign(restart, {
assign(restart, {
auth: true,
group: 'machines',
name: 'restart',
Expand Down
3 changes: 2 additions & 1 deletion lib/machines/show.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -108,7 +109,7 @@ function show(params, cb) {
return method(show, params, cb);
}

Object.assign(show, {
assign(show, {
auth: true,
group: 'machines',
name: 'show',
Expand Down
3 changes: 2 additions & 1 deletion lib/machines/start.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -31,7 +32,7 @@ function start(params, cb) {
return method(start, params, cb);
}

Object.assign(start, {
assign(start, {
auth: true,
group: 'machines',
name: 'start',
Expand Down
3 changes: 2 additions & 1 deletion lib/machines/stop.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -32,7 +33,7 @@ function stop(params, cb) {
return method(stop, params, cb);
}

Object.assign(stop, {
assign(stop, {
auth: true,
group: 'machines',
name: 'stop',
Expand Down
3 changes: 2 additions & 1 deletion lib/machines/update.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var method = require('./../method');
var assign = require('lodash.assign');

/**
* @memberof machines
Expand Down Expand Up @@ -49,7 +50,7 @@ function update(params, cb) {
return method(update, params, cb);
}

Object.assign(update, {
assign(update, {
auth: true,
group: 'machines',
name: 'update',
Expand Down
Loading

0 comments on commit b339932

Please sign in to comment.