🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

node-powertools

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-powertools - npm Package Compare versions

Comparing version

to
2.2.0

8

dist/index.js

@@ -303,7 +303,9 @@ (function (root, factory) {

if (!Array.isArray(options.brackets) || options.brackets.length !== 2) {
throw new Error('Invalid brackets option. It must be an array with two characters.');
throw new Error('Invalid brackets.');
}
const [openBracket, closeBracket] = options.brackets;
const regex = new RegExp(`${Powertools.escape(openBracket)}\\s*([\\w\\s\\.]*)\\s*${Powertools.escape(closeBracket)}`, 'g');
// Escape brackets
var openBracket = options.brackets[0];
var closeBracket = options.brackets[1];
var regex = new RegExp(Powertools.escape(openBracket) + '\\s*([\\w\\s\\.]*)\\s*' + Powertools.escape(closeBracket), 'g');

@@ -310,0 +312,0 @@ // Replace the settings in the input string

{
"name": "node-powertools",
"version": "2.1.6",
"version": "2.2.0",
"description": "Powerful assistive functions for Node and Browser environments.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -259,2 +259,3 @@ <p align="center">

); // Output: 'My favorite color is purple'
powertools.template(

@@ -264,2 +265,3 @@ 'Ian\'s favorite color is {ian.color}',

); // Output: 'Ian\'s favorite color is purple'
powertools.template(

@@ -270,2 +272,8 @@ 'My favorite color is {color}',

); // Output: 'My favorite color is &lt;b&gt;purple&lt;/b&gt;'
powertools.template(
'My favorite color is %color%',
{color: 'purple'},
{brackets: ['%', '%']}
); // Output: 'My favorite color is purple'
```

@@ -272,0 +280,0 @@