Socket
Socket
Sign inDemoInstall

jsesc

Package Overview
Dependencies
0
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

22

jsesc.js

@@ -1,2 +0,2 @@

/*! https://mths.be/jsesc v1.1.0 by @mathias */
/*! https://mths.be/jsesc v1.2.0 by @mathias */
;(function(root) {

@@ -68,2 +68,8 @@

};
var isMap = function(value) {
return toString.call(value) == '[object Map]';
};
var isSet = function(value) {
return toString.call(value) == '[object Set]';
};

@@ -126,2 +132,14 @@ /*--------------------------------------------------------------------------*/

if (!isString(argument)) {
if (isMap(argument)) {
if (argument.size == 0) {
return 'new Map()';
}
return 'new Map(' + jsesc(Array.from(argument), options) + ')';
}
if (isSet(argument)) {
if (argument.size == 0) {
return 'new Set()';
}
return 'new Set(' + jsesc(Array.from(argument), options) + ')';
}
if (isArray(argument)) {

@@ -256,3 +274,3 @@ result = [];

jsesc.version = '1.1.0';
jsesc.version = '1.2.0';

@@ -259,0 +277,0 @@ /*--------------------------------------------------------------------------*/

2

package.json
{
"name": "jsesc",
"version": "1.1.0",
"version": "1.2.0",
"description": "A JavaScript library for escaping JavaScript strings while generating the shortest possible valid output.",

@@ -5,0 +5,0 @@ "homepage": "https://mths.be/jsesc",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc