components_node/functions-generic.js
/**
     * Data treatment for writing content.
     * @static
     * @param {string} strContent 
     * @param {string} specialInstructions db_write_text | db_sanitize | utf8_encode | htmlentities | config-application | env (.env - environment variables) | pdf (convert to text) | json_encode (JavaScript String Encode)
     * @returns {string}
     * @example
     * SyncSystemNS.FunctionsGeneric.contentMaskWrite(variableNameOrText, "db_write_text")
     */
Data treatment for writing content.
Data treatment for writing content .
static contentMaskWrite(strContent, specialInstructions = "")
    {
        let strReturn = strContent;
        if(strReturn)
        {
            if(specialInstructions == "db_write_text") 
            {
                strReturn = strReturn;
            }
            if(specialInstructions == "db_sanitize")
            {
                strReturn = strReturn;
            }
            if(specialInstructions == "env")
            {
                strReturn = strReturn;
            }
        }else{
            strReturn = "";
        }
        return strReturn;
    }
static contentMaskWrite ( strContent , specialInstructions = "" ) { let strReturn = strContent ; if ( strReturn ) { if ( specialInstructions == "db_write_text" ) { strReturn = strReturn ; } if ( specialInstructions == "db_sanitize" ) { strReturn = strReturn ; } if ( specialInstructions == "env" ) { strReturn = strReturn ; } } else { strReturn = "" ; } return strReturn ; }
Data treatment for writing content.
Data treatment for writing content .
//specialInstructions: db_write_text | db_sanitize | utf8_encode | htmlentities | config-application | env (.env - environment variables) | pdf (convert to text) | json_encode (JavaScript String Encode) //Variables. //---------------------- //---------------------- //if(strReturn !== null && typeof(strReturn) !== 'undefined') //db_write_text //---------------------- //TODO: substitute condition with search in string. //---------------------- //db_sanitize //---------------------- //---------------------- //env (.env - environment variables) //---------------------- //---------------------- //Usage. //---------------------- //SyncSystemNS.FunctionsGeneric.contentMaskWrite("return test - data", "db_write_text"); //----------------------