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

Method _conformIncludes

src/model.js:340–353  ·  view source on GitHub ↗
(options, self)

Source from the content-addressed store, hash-verified

338 }
339
340 static _conformIncludes(options, self) {
341 if (!options.include) return;
342
343 // if include is not an array, wrap in an array
344 if (!Array.isArray(options.include)) {
345 options.include = [options.include];
346 } else if (!options.include.length) {
347 delete options.include;
348 return;
349 }
350
351 // convert all included elements to { model: Model } form
352 options.include = options.include.map(include => this._conformInclude(include, self));
353 }
354
355 static _transformStringAssociation(include, self) {
356 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
testsqlFunction · 0.80
include.test.jsFile · 0.80
constructorMethod · 0.80

Calls 1

_conformIncludeMethod · 0.95

Tested by 1

testsqlFunction · 0.64