MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / _getColumnsToAdd

Function _getColumnsToAdd

services/app.js:1227–1249  ·  view source on GitHub ↗
(oldColumns, newColumns)

Source from the content-addressed store, hash-verified

1225}
1226
1227function _getColumnsToAdd(oldColumns, newColumns) {
1228 try {
1229 const originalColumns = oldColumns;
1230
1231 const addedColumns = [];
1232
1233 for (let i = 0; i < newColumns.length; i++) {
1234 const column = _.first(_.where(originalColumns, {
1235 name: newColumns[i].name,
1236 }));
1237 if (!column) {
1238 addedColumns.push(newColumns[i]);
1239 }
1240 }
1241 return addedColumns;
1242 } catch (e) {
1243 winston.log('error', {
1244 error: String(e),
1245 stack: new Error().stack,
1246 });
1247 return null;
1248 }
1249}
1250
1251function _getDefaultColumnWithDataType(type) {
1252 try {

Callers 1

upsertTableFunction · 0.85

Calls 1

firstMethod · 0.80

Tested by

no test coverage detected