concat-regexp
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -13,2 +13,3 @@ var slice = Array.prototype.slice | ||
var last = pieces.length - 1 | ||
var loner = last === i | ||
@@ -24,2 +25,9 @@ for (; i <= last; i++) { | ||
// Don’t strip the boundaries of | ||
// lone regular expressions | ||
if (loner && boundary.test(piece)) { | ||
regexp += piece | ||
continue | ||
} | ||
// Add sanitised piece | ||
@@ -26,0 +34,0 @@ if (i < last) { |
{ | ||
"name": "concat-regexp", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A function that takes a series of regular expressions and returns them in concatenated form.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -37,1 +37,11 @@ var run = require('tape') | ||
}) | ||
run('it handles lone regular expressions like RegExp', function(test) { | ||
test.deepEqual( | ||
concat('/a/'), | ||
RegExp('/a/'), | ||
RegExp('/a/').toString() | ||
) | ||
test.end() | ||
}) |
3834
78