UNPKG

hydrate-mongodb

Version:
31 lines (30 loc) 893 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var mappingError_1 = require("./mappingError"); var ReadContext = (function () { function ReadContext(session) { this.session = session; this.path = ""; } ReadContext.prototype.addError = function (message, path) { if (!this.errors) { this.errors = []; this.hasErrors = true; } this.errors.push({ message: message, path: path || this.path }); }; ReadContext.prototype.addFetch = function (path) { if (!this.fetches) { this.fetches = []; } this.fetches.push(path); }; ReadContext.prototype.getErrorMessage = function () { return mappingError_1.createErrorMessage(this.errors); }; return ReadContext; }()); exports.ReadContext = ReadContext;