You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

string-tags

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-tags - npm Package Compare versions

Comparing version

to
0.1.2

2

index.js

@@ -98,3 +98,3 @@ "use strict";

if (module && module.exports) {
if (typeof module !== 'undefined' && module.hasOwnProperty('exports')) {
module.exports = Tags;

@@ -101,0 +101,0 @@ } else {

{
"name": "string-tags",
"version": "0.1.1",
"version": "0.1.2",
"description": "common tags for es6 string template",

@@ -5,0 +5,0 @@ "repository": {

@@ -8,10 +8,14 @@

let input = "*)";
let reg1 = tags.regexp`\\\(${input}\gi`;
let reg1 = tags.regexp`\\\(${input}\g`;
// this is same as
reg1 = /\\\(\*\)/gi;
or
reg1 = new RegExp("\\\\\\(\\*\\)", "gi");
// use string-tags for regexp only when embedded expressions is needed
// the above line is same as
let inputEscaped = input.replace(/\*\)/g, "\\$&");
reg1 = new RegExp("\\\\\\(" + inputEscaped, "g);
// string-tags make regexp much cleaner when you have to use expression in regexp
// don't use string-tags for regexp when there is no expression, use native js syntax instead:
reg1 = /\\\(\*\)/g;
```

@@ -18,0 +22,0 @@