delimiter-regex
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -55,3 +55,3 @@ # {%= name %} {%= badge("fury") %} | ||
## License | ||
{%= copyright() %} | ||
{%= copyright({year: 2014}) %} | ||
{%= license() %} | ||
@@ -58,0 +58,0 @@ |
@@ -24,3 +24,3 @@ 'use strict'; | ||
var opts = extend({flags: ''}, options); | ||
var body = '\\s*([\\s\\S]*?)\\s*'; | ||
var body = '([\\s\\S]+?)'; | ||
@@ -27,0 +27,0 @@ open = open ? open : '\\${'; |
{ | ||
"name": "delimiter-regex", | ||
"description": "Create regex for template delimiters.", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"homepage": "https://github.com/jonschlinkert/delimiter-regex", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -63,3 +63,3 @@ # delimiter-regex [![NPM version](https://badge.fury.io/js/delimiter-regex.svg)](http://badge.fury.io/js/delimiter-regex) | ||
## License | ||
Copyright (c) 2015 Jon Schlinkert | ||
Copyright (c) 2014-2015 Jon Schlinkert | ||
Released under the MIT license | ||
@@ -69,2 +69,2 @@ | ||
_This file was generated by [verb](https://github.com/assemble/verb) on January 15, 2015._ | ||
_This file was generated by [verb](https://github.com/assemble/verb) on February 02, 2015._ |
24
test.js
@@ -19,4 +19,4 @@ /*! | ||
it('should return default es6 regex:', function () { | ||
assert.deepEqual(/\${\s*([\s\S]*?)\s*}/, delims()); | ||
assert.deepEqual(/\${\s*([\s\S]*?)\s*}/, delims('\\${', '}')); | ||
assert.deepEqual(/\${([\s\S]+?)}/, delims()); | ||
assert.deepEqual(/\${([\s\S]+?)}/, delims('\\${', '}')); | ||
}); | ||
@@ -30,3 +30,3 @@ | ||
assert.equal(match('---\na: b\nc: d\n---\ncontent', delims('---', '---'))[0], '---\na: b\nc: d\n---'); | ||
assert.equal(match('---\na: b\nc: d\n---\ncontent', delims('---', '---'))[1], 'a: b\nc: d'); | ||
assert.equal(match('---\na: b\nc: d\n---\ncontent', delims('---\\s*', '\\s*---'))[1], 'a: b\nc: d'); | ||
assert.equal(match('abc/${foo}/${bar}/xyz', delims())[1], 'foo'); | ||
@@ -36,21 +36,21 @@ }); | ||
it('should support regexp flags:', function () { | ||
assert.deepEqual(/---\s*([\s\S]*?)\s*---/g, delims('---', '---', {flags: 'g'})); | ||
assert.deepEqual(/\${\s*([\s\S]*?)\s*}/gm, delims({flags: 'gm'})); | ||
assert.deepEqual(/---([\s\S]+?)---/g, delims('---', '---', {flags: 'g'})); | ||
assert.deepEqual(/\${([\s\S]+?)}/gm, delims({flags: 'gm'})); | ||
}); | ||
it('should not escape characters:', function () { | ||
assert.deepEqual(/---(\w)*\s*([\s\S]*?)\s*---/, delims('---(\\w)*', '---')); | ||
assert.deepEqual(/---(\w)*([\s\S]+?)---/, delims('---(\\w)*', '---')); | ||
}); | ||
it('should support list format:', function () { | ||
assert.deepEqual(/---\s*([\s\S]*?)\s*---/, delims('---', '---')); | ||
assert.deepEqual(/\{\{\s*([\s\S]*?)\s*\}\}/, delims('\\{\\{', '\\}\\}')); | ||
assert.deepEqual(/\{{\s*([\s\S]*?)\s*}}/, delims('\\{{', '}}')); | ||
assert.deepEqual(/---([\s\S]+?)---/, delims('---', '---')); | ||
assert.deepEqual(/\{\{([\s\S]+?)\}\}/, delims('\\{\\{', '\\}\\}')); | ||
assert.deepEqual(/\{{([\s\S]+?)}}/, delims('\\{{', '}}')); | ||
}); | ||
it('should support array format:', function () { | ||
assert.deepEqual(/---\s*([\s\S]*?)\s*---/, delims(['---', '---'])); | ||
assert.deepEqual(/\{\{\s*([\s\S]*?)\s*\}\}/, delims(['\\{\\{', '\\}\\}'])); | ||
assert.deepEqual(/\{{\s*([\s\S]*?)\s*}}/, delims(['\\{{', '}}'])); | ||
assert.deepEqual(/---([\s\S]+?)---/, delims(['---', '---'])); | ||
assert.deepEqual(/\{\{([\s\S]+?)\}\}/, delims(['\\{\\{', '\\}\\}'])); | ||
assert.deepEqual(/\{{([\s\S]+?)}}/, delims(['\\{{', '}}'])); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7578