MCPcopy Create free account
hub / github.com/Automattic/mongoose / handleArray

Function handleArray

lib/schema/string.js:469–477  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

467}
468
469function handleArray(val) {
470 var _this = this;
471 if (!Array.isArray(val)) {
472 return [this.castForQuery(val)];
473 }
474 return val.map(function(m) {
475 return _this.castForQuery(m);
476 });
477}
478
479SchemaString.prototype.$conditionalHandlers =
480 utils.options(SchemaType.prototype.$conditionalHandlers, {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected