function clearData(data, imports) {
    return new Promise(resolve => {
        if (!data) {
            return resolve(data);
        }

        const origData = data;
        try {
            // Change "// ..." comment to "/* ... */"
            const origData = data;

            data = data.replaceAll(new RegExp('#swagger\\.description\\s*\\=\\s*'), ' #swagger.description = ');

            // Backuping descriptions
            let swaggerDescriptionsStorage = new Map();
            if (data.includes('#swagger.description')) {
                let swaggerDescriptions = data.split(new RegExp('#swagger.description = '));
                for (let idx = 1; idx < swaggerDescriptions.length; ++idx) {
                    let key = `__${statics.UNKNOWN}__swagger_description__${idx}`; // TODO: put unknown char here
                    let description = utils.popString(swaggerDescriptions[idx], true);
                    swaggerDescriptionsStorage.set(key, description);
                    data = data.replace('#swagger.description = ' + description, key);
                }
            }

            try {
                data = data.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*headers\\s*\\n*\\t*\\[\\s*\\n*\\t*')).join('.headers[');
                data = data.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*header\\s*\\n*\\t*\\(\\s*\\n*\\t*'));
                if (data.length > 1) {
                    for (let idxHeader = 1; idxHeader < data.length; ++idxHeader) {
                        data[idxHeader] = data[idxHeader].replace(')', ']');
                    }
                    data = data.join('.headers[');
                } else {
                    data = data[0];
                }
                data = data.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*header\\s*\\n*\\t*\\(\\s*\\n*\\t*')).join('.headers(');
                if (data.split('.headers[').length > 1) {
                    data = data.split('.headers[');
                    for (let idxHeaders = 1; idxHeaders < data.length; ++idxHeaders) {
                        let d = data[idxHeaders];
                        if (d[0] === "'" || d[0] === '"' || d[0] === '`') {
                            let str = utils.popString(d);
                            d = d.replace(new RegExp(`.${str}.`), `${statics.STRING_QUOTE}${str}${statics.STRING_QUOTE}`);
                            data[idxHeaders] = d;
                        }
                    }
                    data = data.join('.headers[');
                }
            } catch (err) {
                data = origData;
            }

            data = data.replaceAll('\r', '\n');
            data = data.replaceAll('\\r', '\n');
            data = data.replaceAll('*//*', '*/\n/*');
            data = data.replaceAll('*//*', '*/\n/*');
            data = data.replaceAll('*///', '*/\n//');
            data = data.replaceAll('///', '//');
            data = data.replaceAll('://', ':/' + statics.STRING_BREAKER + '/'); // REFACTOR: improve this. Avoiding cases such as: ... http://... be handled as a comment

            data = utils.removeRegexes(data);

            data = data.split('//').map((e, idx) => {
                if (idx != 0) {
                    return e.replace('\n', ' */ \n');
                }
                return e;
            });
            data = data.join('/*');

            data = data.replaceAll(':/' + statics.STRING_BREAKER + '/', '://');

            let aData = data.replaceAll('\n', statics.STRING_BREAKER);
            aData = aData.replaceAll('\t', ' ');

            aData = aData.replaceAll(statics.STRING_BREAKER, '\n');
            aData = aData.split(new RegExp('axios\\s*\\n*\\t*\\.\\w*', 'i'));
            aData = aData.join('axios.method');

            /**
             * Removing express-async-handler function
             */
            let expressAsyncHandler = null;
            if (imports) {
                let idx = imports.findIndex(e => e.fileName == 'express-async-handler');
                if (idx > -1) {
                    if (!imports[idx].varFileName && imports[idx].exports.length > 0) {
                        expressAsyncHandler = imports[idx].exports[0].varName;
                    } else {
                        expressAsyncHandler = imports[idx].varFileName;
                    }
                }
                if (expressAsyncHandler) {
                    aData = aData.split(new RegExp(`\\s*\\n*\\t*${expressAsyncHandler}\\s*\\n*\\t*\\(`));
                    aData = aData.join(' ');
                }
            }

            aData = removeAwaitsAndAsyncs(aData);

            // Restoring descriptions
            for (let idx = 0; idx < swaggerDescriptionsStorage.size; ++idx) {
                let key = `__${statics.UNKNOWN}__swagger_description__${idx + 1}`;
                let description = swaggerDescriptionsStorage.get(key);
                aData = aData.replace(key, ` #swagger.description = ${description}`);
            }

            return resolve(aData);
        } catch (err) {
            return resolve(origData);
        }
    });
}
Removes unnecessary content.
@param {string} data file content.