MCPcopy
hub / github.com/strongloop/loopback / setupOptionsArgs

Function setupOptionsArgs

lib/model.js:480–492  ·  view source on GitHub ↗
(accepts, modelClass)

Source from the content-addressed store, hash-verified

478 };
479
480 function setupOptionsArgs(accepts, modelClass) {
481 if (!Array.isArray(accepts))
482 accepts = [accepts];
483
484 return accepts.map(function(arg) {
485 if (arg.http && arg.http === 'optionsFromRequest') {
486 // clone to preserve the input value
487 arg = extend({}, arg);
488 arg.http = createOptionsViaModelMethod.bind(modelClass);
489 }
490 return arg;
491 });
492 }
493
494 function createOptionsViaModelMethod(ctx) {
495 const ModelCtor = (ctx.method && ctx.method.ctor) || this;

Callers 1

model.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…