Code coverage report for brnfckr/brnfckr.js

Statements: 73.68% (14 / 19)      Branches: 65.22% (15 / 23)      Functions: 66.67% (2 / 3)      Lines: 73.68% (14 / 19)     

All files » brnfckr/ » brnfckr.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55  1     1     1       1 1 1         1   1 4         1             1               1 1 1                      
/*! http://mths.be/brnfckr v0.1.1 by @mathias */
;(function(root) {
 
	// Detect free variables `exports`
	var freeExports = typeof exports == 'object' && exports;
 
	// Detect free variable `module`
	var freeModule = typeof module == 'object' && module &&
		module.exports == freeExports && module;
 
	// Detect free variable `global` and use it as `root`
	var freeGlobal = typeof global == 'object' && global;
	Eif (freeGlobal.global === freeGlobal) {
		root = freeGlobal;
	}
 
	/*--------------------------------------------------------------------------*/
 
	var regexNotBrainfuck = /[^\+\-<>\[\],\.]/g;
 
	var minify = function(code) {
		return code.replace(regexNotBrainfuck, '');
	};
 
	/*--------------------------------------------------------------------------*/
 
	var brnfckr = {
		'version': '0.1.1',
		'minify': minify
	};
 
	// Some AMD build optimizers, like r.js, check for specific condition patterns
	// like the following:
	Iif (
		typeof define == 'function' &&
		typeof define.amd == 'object' &&
		define.amd
	) {
		define(function() {
			return brnfckr;
		});
	}	else Eif (freeExports && !freeExports.nodeType) {
		Eif (freeModule) { // in Node.js or RingoJS v0.8.0+
			freeModule.exports = brnfckr;
		} else { // in Narwhal or RingoJS v0.7.0-
			for (var key in brnfckr) {
				brnfckr.hasOwnProperty(key) && (freeExports[key] = brnfckr[key]);
			}
		}
	} else { // in Rhino or a web browser
		root.brnfckr = brnfckr;
	}
 
}(this));