regexify
v2.2.0
Published
Regex everything!
Downloads
6
Readme
node-regexify
Regex everything! Well...almost ;)
Installation
npm install regexify --save
Example usage:
var regexify = require('regexify');
var assert = require('assert');
assert.deepEqual(regexify(undefined), /.^/);
assert.deepEqual(regexify(false), /.^/);
assert.deepEqual(regexify(null), /.^/);
assert.deepEqual(regexify(''), /.^/);
assert.deepEqual(regexify(['foo', 'bar']), /foo|bar/);
assert.deepEqual(regexify(['foo', './bar']), /foo|\.\/bar/);
assert.deepEqual(regexify('./foobar'),/\.\/foobar/);
assert.deepEqual(regexify('foobar'), /foobar/);
assert.deepEqual(regexify(/foobar/), /foobar/);