A Great Share, A Cross Version Library Template (S...
# suitescript
r
A Great Share, A Cross Version Library Template (Server/Client Side use)
Copy code
/**
* Charon.js
* 
* Author: Renandro Valparaiso
* 
* The name Charon means 'fierce brightness' in Greek, the Latin or Roman equivalent was Charun.
* This script is the ferry man of script versions
* 
*
*/

function scripting() {
//GENERIC FUNCTIONS/ DECLARATIONS GOES HERE
	this.ss_version = 'undefined';
}

(function(export){
//GLOBAL CONSTANTS HERE
	
	try {
		define([], function() {
			export.ss_version = '2';
			//DO BELOW HERE YOUR OVERWRITE F's! FOR 2.0 Scripts
			
			return export;
		}.bind(this));
	} catch(e){
		Object.keys(export).forEach(function(k){
			this[k] = export[k];
		});
		
		this.ss_version = '1';
		//DO BELOW HERE YOUR OVERWRITE F's! FOR 1.0 Scripts
	}
})(new scripting());