New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sugar-high

Package Overview
Dependencies
Maintainers
0
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sugar-high - npm Package Compare versions

Comparing version 0.7.4 to 0.7.5

34

lib/index.js

@@ -223,5 +223,7 @@ // @ts-check

let __strQuote = null
let __regexQuoteStart = false
let __strTemplateExprStack = 0
let __strTemplateQuoteStack = 0
const inStringQuotes = () => __strQuote !== null
const inRegexQuotes = () => __regexQuoteStart
const inStrTemplateLiterals = () => (__strTemplateQuoteStack > __strTemplateExprStack)

@@ -279,8 +281,16 @@ const inStrTemplateExpr = () => __strTemplateQuoteStack > 0 && (__strTemplateQuoteStack === __strTemplateExprStack)

const append = (_type, _token) => {
if (_token) {
current = _token
/**
*
* @param {number} type_
* @param {string} token_
*/
const append = (type_, token_) => {
if (type_ || token_) {
const nType = types[type_]
}
if (token_) {
current = token_
}
if (current) {
type = _type || classify(current)
type = type_ || classify(current)
/** @type [number, string] */

@@ -461,3 +471,9 @@ const pair = [type, current]

if (curr === '<' && (next === '/' || isAlpha(next))) {
__jsxEnter = true
if (
!inStringContent() &&
!inJsxLiterals() &&
!inRegexQuotes()
) {
__jsxEnter = true
}
}

@@ -493,2 +509,3 @@ }

__regexQuoteStart = true
const start = i++

@@ -501,7 +518,8 @@

let foundClose = false
// regex
// traverse to find closing regex slash
for (; !isEol(); i++) {
if (code[i] === '/' && code[i - 1] !== '\\') {
foundClose = true
// append regex flags
// end of regex, append regex flags
while (start !== i && /^[a-z]$/.test(code[i + 1]) && !isEol()) {

@@ -513,2 +531,4 @@ i++

}
__regexQuoteStart = false
if (start !== i && foundClose) {

@@ -515,0 +535,0 @@ // If current line is fully closed with string quotes or regex slashes,

{
"name": "sugar-high",
"version": "0.7.4",
"version": "0.7.5",
"type": "module",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

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