mini-unassert
a small and fast unassert transform
It transforms assert
calls to void
expressions. Use a minifier like terser to completely remove them.
Input:
var assert = assertassert
Output:
;void truevoid typeof x 'string'void void {}
After minification:
;
Install
npm install mini-unassert
Usage
It works as a stream and as a browserify transform.
var unassert = fs
browserify -g mini-unassert -g uglifyify
API
stream = unassert(opts={})
Create a stream that replaces assert calls with void
expressions.
opts.modules
is an array of assertion module names, defaulting to['assert']
.
b.transform(unassert, opts={})
Add unassert
as a browserify transform. b
is an instance of browserify.
- Set
opts.global
to run it on all files, including dependencies in node_modules. (recommended) opts.modules
is an array of assertion module names, defaulting to['assert']
.