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

Method constructor

lib/error/objectExpected.js:18–23  ·  view source on GitHub ↗

* Strict mode error constructor * * @param {string} type * @param {string} value * @api private

(path, val)

Source from the content-addressed store, hash-verified

16 * @api private
17 */
18 constructor(path, val) {
19 const typeDescription = Array.isArray(val) ? 'array' : 'primitive value';
20 super('Tried to set nested object field `' + path +
21 `\` to ${typeDescription} \`` + val + '`');
22 this.path = path;
23 }
24}
25
26Object.defineProperty(ObjectExpectedError.prototype, 'name', {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected