/
Stameskaaa
/
Server
Обзор
Документация
Войти
/
Stameskaaa
/
Server
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/mongoose/lib/error/objectExpected.js
30 строк
637 B
Stameskaaa
first
19 июн 2024, 15:02
19 июн 2024, 15:02
ac1472e
Код
Авторство
О чём код?
/*! * Module dependencies. */ 'use strict'; const MongooseError = require('./'); class ObjectExpectedError extends MongooseError { /** * Strict mode error constructor * * @param {string} type * @param {string} value * @api private */ constructor(path, val) { const typeDescription = Array.isArray(val) ? 'array' : 'primitive value'; super('Tried to set nested object field `' + path + `\` to ${typeDescription} \`` + val + '`'); this.path = path; } } Object.defineProperty(ObjectExpectedError.prototype, 'name', { value: 'ObjectExpectedError' }); module.exports = ObjectExpectedError;