string-tags
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16701
31