n8n/cypress/fixtures/Dummy_javascript.txt
Milorad FIlipović 7ebf8f327a
fix(editor): Fix disappearing NDV header in code nodes (#7290)
Github issue / Community forum post (link here to close automatically):

---------

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2023-10-05 12:31:52 +02:00

43 lines
1 KiB
Plaintext

var File = function(url, object){
File.list = Array.isArray(File.list)? File.list : [];
File.progress = File.progress || 0;
this.progress = 0;
this.object = object;
this.url = url;
};
File.indexOf = function(term){
for(var index in File.list){
var file = File.list[index];
if (file.equals(term) || file.url === term || file.object === term) {
return index;
}
}
return -1;
};
File.find = function(term){
var index = File.indexOf(term);
return ~index && File.list[index];
};
File.prototype.equals = function(file){
var isFileType = file instanceof File;
return isFileType && this.url === file.url && this.object === file.object;
};
File.prototype.save = function(update){
update = typeof update === 'undefined'? true : update;
if(Array.isArray(File.list)){
var index = File.indexOf(this);
if(~index && update) {
File.list[index] = this;
console.warn('File `%s` has been loaded before and updated now for: %O.', this.url, this);
}else File.list.push(this);
console.log(File.list)
}else{
File.list = [this];
}
return this;
};