New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.0 to 0.1.1

2

package.json
{
"name": "string-tags",
"version": "0.1.0",
"version": "0.1.1",
"description": "common tags for es6 string template",

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

@@ -5,17 +5,24 @@

```javascript
const tags = require('../index.js');
const tags = require('../index.js');
let reg1 = tags.regexp`\\\(${"*("}\\\gi`;
let input = "*)";
let reg1 = tags.regexp`\\\(${input}\gi`;
// this is same as
reg1 = /\\\(\*\)/gi;
or
reg1 = new RegExp("\\\\\\(\\*\\)", "gi");
// use string-tags for regexp only when embedded expressions is needed
```
this is same as `reg1 = /\\\(\*\(\\/gi;`. use string-tags for regexp only embedded expressions is needed
### XML
```javascript
const tags = require('../index.js');
const tags = require('../index.js');
let xml1 = tags.xml`<a>${'&<>'}</a>`; // escape the xml string
let dom = tags.dom_xml`<a>${'&<>'}</a>`; // output a document instead of string
let input = "&<>";
let xml1 = tags.xml`<a>${input}</a>`; // escape the xml string
let dom = tags.dom_xml`<a>${input}</a>`; // output a document instead of string
```

@@ -5,4 +5,4 @@ const assert = require('assert');

let reg1 = tags.regexp`\\\(${"*("}\\\gi`;
let reg2 = /\\\(\*\(\\/gi;
let reg1 = tags.regexp`\\\(${"*)"}\\\gi`;
let reg2 = /\\\(\*\)\\/gi;

@@ -9,0 +9,0 @@ assert.equal(reg1.source, reg2.source, 'regexp source');

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