Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

delimiter-regex

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delimiter-regex - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

.verb.md

@@ -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._

@@ -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(['\\{{', '}}']));
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc