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

delims

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delims - npm Package Compare versions

Comparing version 0.1.4 to 0.2.0

2

bower.json
{
"name": "delims",
"version": "0.1.4",
"version": "0.2.0",
"main": [

@@ -5,0 +5,0 @@ "index.js"

@@ -8,13 +8,16 @@ /*!

const _ = require('lodash');
const utils = require('./lib/utils');
'use strict';
var utils = require('./lib/utils');
var arrayify = require('arrayify-compact');
var extend = require('xtend');
// Generate RegExp patterns dynamically. By default, patterns use
// [\s\S] instead to avoid the need for multiline and dotall flags.
var delims = module.exports = function (delims, options) {
if(!_.isArray(delims)) {options = delims; delims = ['---', '---'];}
if(!Array.isArray(delims)) {options = delims; delims = ['---', '---'];}
// Defaults
var opts = _.defaults({}, options, {
var opts = extend({}, {
beginning: '^', // '^' Matches beginning of input.

@@ -25,3 +28,3 @@ matter: '([\\s\\S]+?)', // The "content" between the delims

flags: '' // g, m, i
});
}, options);
opts.body = delims[2] || opts.body || '';

@@ -42,4 +45,4 @@

delims.arrayify = utils.arrayify;
delims.arrayify = arrayify;
delims.escapeDelim = utils.escapeDelim;
delims.buildRegexGroup = utils.buildRegexGroup;

@@ -8,9 +8,9 @@ /*!

const _ = require('lodash');
const utils = module.exports = {};
'use strict';
utils.arrayify = function(arr) {
return !Array.isArray(arr) ? [arr] : _.compact(arr);
};
var extend = require('xtend');
var arrayify = require('arrayify-compact');
var utils = module.exports = {};
// Escape custom template delimiters

@@ -23,3 +23,3 @@ utils.escapeDelim = function (re) {

utils.buildRegexGroup = function (re, options) {
var opts = _.extend({
var opts = extend({
escape: false, // Escape delimiter regex

@@ -29,3 +29,3 @@ noncapture: false // Build a non-capture group

re = utils.arrayify(re);
re = arrayify(re);
var len = re.length;

@@ -32,0 +32,0 @@

{
"name": "delims",
"description": "Generate RegExp for delimiters, to be used with templates, files or data streams.",
"version": "0.1.4",
"version": "0.2.0",
"homepage": "https://github.com/jonschlinkert/delims",

@@ -32,3 +32,4 @@ "author": {

"dependencies": {
"lodash": "~2.4.1"
"arrayify-compact": "^0.1.0",
"xtend": "^3.0.0"
},

@@ -35,0 +36,0 @@ "keywords": [

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