Skip to content

Commit

Permalink
undefined management
Browse files Browse the repository at this point in the history
  • Loading branch information
simon louvet committed Nov 16, 2023
1 parent 75f4567 commit 39b3ec3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions core/lib/fragment_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ module.exports = {
return await this.persist (data,fragCaller,exitingFrag)
} else {
for (let key in data) {
// console.log('persist key ',key,'value',data[key])
const persistReturn = await this.persistObject(data[key],fragCaller);
if (persistReturn?._id){
data[key] = {
Expand Down
2 changes: 1 addition & 1 deletion engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"request": "^2.88.0",
"sequelize": "^5.21.2",
"sheetrock": "^1.1.4",
"sift": "^8.5.0",
"sift": "^17.0.1",
"sift-date": "0.0.1",
"slugify": "^1.6.6",
"speakingurl": "^14.0.1",
Expand Down
8 changes: 6 additions & 2 deletions engine/services/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ class Engine {
try {
// if (!frag){
// throw new Error('frag have to be set');
// }
// }buildDfobFragmentFlow(')
historic_object.componentId = processingNode.component._id;
historic_object.persistProcess = processingNode.component.persistProcess;
historic_object.processId = this.processId;
Expand Down Expand Up @@ -802,9 +802,12 @@ class Engine {
// console.log('__________ componentFlowDfob :',componentFlowDfob)

if (this.config.quietLog != true) console.time("recompose-DfobFlow");
// console.log('dfobFlow 1',dfobFlow)
for (var componentFlowDfobKey in componentFlowDfob) {
if (componentFlowDfob[componentFlowDfobKey].data != undefined) {
if ('data' in componentFlowDfob[componentFlowDfobKey]) {
// console.log('componentFlowDfobKey 1',componentFlowDfobKey)
if (dfobFlow[componentFlowDfobKey].key != undefined) {
// console.log('componentFlowDfobKey 2',componentFlowDfobKey)
dfobFlow[componentFlowDfobKey].objectToProcess[dfobFlow[componentFlowDfobKey].key] =
componentFlowDfob[componentFlowDfobKey].data
} else {
Expand All @@ -822,6 +825,7 @@ class Engine {
componentFlowDfob[componentFlowDfobKey]
}
}
// console.log('dfobFlow 2',dfobFlow)
if (this.config.quietLog != true) console.timeEnd("recompose-DfobFlow");
} else {
// console.log('WITHOUT DFOB');
Expand Down
5 changes: 3 additions & 2 deletions engine/utils/objectTransformationV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
},

execute: function(source, pullParams, jsonTransformPattern, options, config) {
// console.log(source);
// console.log('Oject TRansformer source',source);
// console.log('-pullParams',pullParams);
// console.log('-jsonTransformPattern', jsonTransformPattern);

Expand Down Expand Up @@ -107,8 +107,9 @@ module.exports = {
}
},
escapeString(source){

// console.log('escapeString',source);
if(typeof source === 'string' || source instanceof String){
// console.log('escapeString',this.unicode.utoa(source))
return `eval(this.unicode.atou(\`${this.unicode.utoa(source)}\`))`
} else if(Array.isArray(source)){
return source.map(r=>this.escapeString(r))
Expand Down
6 changes: 4 additions & 2 deletions engine/workspaceComponentExecutor/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ class Filter {

try {
// (source, pullParams, jsonTransformPattern, options) {
// console.log('filter',filter);
console.log('filter',filter);
console.log('usableData',usableData);
// console.log('pullParams',pullParams);
let filterResult = this.objectTransformation.execute(usableData,pullParams, filter);
// console.log('filterResult',filterResult);
console.log('filterResult',filterResult);
var resultData = usableData.filter(this.sift(filterResult));
console.log('resultData',resultData)
resolve({
data: resultData
})
Expand Down

0 comments on commit 39b3ec3

Please sign in to comment.