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

Function checkForColumnsExistance

test/CloudObject/test.js:138–158  ·  view source on GitHub ↗
(columns)

Source from the content-addressed store, hash-verified

136 });
137
138 function checkForColumnsExistance(columns) {
139 var defaultColumns = ["id", "expires", "updatedAt", "createdAt", "ACL"];
140 var customColumns = [];
141 for(var i = 0, length = columns.length; i < length; i++){
142 //filter out custom coulumns for check
143 if(defaultColumns.indexOf(columns[i].document.name) < 0){
144 customColumns.push(JSON.stringify({
145 type: columns[i].document.dataType,
146 name: columns[i].document.name
147 })
148 )
149 }
150 }
151 for (column in autoColumns) {
152 // if column to be added is not actually added
153 var columnString = JSON.stringify({type: column, name: autoColumns[column]});
154 if(customColumns.indexOf(columnString) < 0)
155 return column;
156 }
157 return null;
158 }
159 });
160
161 it("Should add a null value in a column", function(done) {

Callers 1

test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected