MCPcopy Create free account
hub / github.com/TritonDataCenter/node-manta / cloneJob

Function cloneJob

lib/client.js:147–170  ·  view source on GitHub ↗
(job)

Source from the content-addressed store, hash-verified

145///--- Helpers
146
147function cloneJob(job) {
148 if (typeof (job) === 'string') {
149 return ({phases: [{exec: job}]});
150 } else if (Array.isArray(job)) {
151 return ({
152 phases: job.map(function (j) {
153 if (typeof (j) === 'object') {
154 return (j);
155 } else if (typeof (j) === 'string') {
156 return ({
157 exec: j
158 });
159 } else {
160 throw new TypeError(util.inspect(j) +
161 ' invalid');
162 }
163 })
164 });
165 } else if (typeof (job) === 'object') {
166 return (clone(job));
167 } else {
168 throw new TypeError('job (object) required');
169 }
170}
171
172/**
173 * HTTP Header names are case insensitive, so we ensure

Callers 1

client.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected