MCPcopy
hub / github.com/sequelize/sequelize / mapValueFieldNames

Function mapValueFieldNames

lib/utils.js:223–238  ·  view source on GitHub ↗
(dataValues, fields, Model)

Source from the content-addressed store, hash-verified

221
222/* Used to map field names in values */
223function mapValueFieldNames(dataValues, fields, Model) {
224 const values = {};
225
226 for (const attr of fields) {
227 if (dataValues[attr] !== undefined && !Model._virtualAttributes.has(attr)) {
228 // Field name mapping
229 if (Model.rawAttributes[attr] && Model.rawAttributes[attr].field && Model.rawAttributes[attr].field !== attr) {
230 values[Model.rawAttributes[attr].field] = dataValues[attr];
231 } else {
232 values[attr] = dataValues[attr];
233 }
234 }
235 }
236
237 return values;
238}
239exports.mapValueFieldNames = mapValueFieldNames;
240
241function isColString(value) {

Callers

nothing calls this directly

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…