rocambole-strip-alert

Strip alert statements from a rocambole AST

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
rocambole-strip-alert
101.0.09 years ago10 years agoMinified + gzip package size for rocambole-strip-alert in KB

Readme

rocambole-strip-alert Build Status
Strip alert statements from a rocambole AST

Install

npm install --save rocambole-strip-alert

Example

var rocambole = require('rocambole');
var stripAlert = require('rocambole-strip-alert');

rocambole.moonwalk('if (true) { alert("foo"); }', function (node) {
	stripAlert(node);
}).toString();
//=> if (true) { void 0; }

To prevent any side-effects, alert is replaced with void 0 instead of being removed.

License

MIT © Patrick Williams