Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 0.1.1 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 @@

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