MCPcopy
hub / github.com/sequelize/sequelize / _conformIncludes

Method _conformIncludes

lib/model.js:317–330  ·  view source on GitHub ↗
(options, self)

Source from the content-addressed store, hash-verified

315 }
316
317 static _conformIncludes(options, self) {
318 if (!options.include) return;
319
320 // if include is not an array, wrap in an array
321 if (!Array.isArray(options.include)) {
322 options.include = [options.include];
323 } else if (!options.include.length) {
324 delete options.include;
325 return;
326 }
327
328 // convert all included elements to { model: Model } form
329 options.include = options.include.map(include => this._conformInclude(include, self));
330 }
331
332 static _transformStringAssociation(include, self) {
333 if (self && typeof include === 'string') {

Callers 11

_conformIncludeMethod · 0.95
_baseMergeMethod · 0.95
scopeMethod · 0.95
findAllMethod · 0.95
aggregateMethod · 0.95
bulkBuildMethod · 0.95
bulkCreateMethod · 0.95
constructorMethod · 0.80
testsqlFunction · 0.80
include.test.jsFile · 0.80

Calls 1

_conformIncludeMethod · 0.95

Tested by 1

testsqlFunction · 0.64