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

Function castMatrix

test/types.array.test.js:2288–2292  ·  view source on GitHub ↗
(Model, value)

Source from the content-addressed store, hash-verified

2286 }
2287
2288 async function castMatrix(Model, value) {
2289 const doc = new Model({ matrix: value });
2290 await doc.validate();
2291 return doc.toObject().matrix;
2292 }
2293
2294 it('applies only to the array it is set on', async function() {
2295 // Outer array only: the inner array still wraps

Callers 1

Calls 2

validateMethod · 0.95
toObjectMethod · 0.80

Tested by

no test coverage detected