Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sucrase

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sucrase - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

38

dist/index.js

@@ -53,3 +53,3 @@ "use strict";

else {
copyToken();
processStringPropValue();
}

@@ -73,2 +73,8 @@ }

}
function processStringPropValue() {
var value = tokens[tokenIndex].value;
var replacementCode = formatJSXTextReplacement(value);
var literalCode = formatJSXStringValueLiteral(value);
replaceToken(literalCode + replacementCode);
}
/**

@@ -123,11 +129,3 @@ * Process the first part of a tag, before any props.

else if (matches(['jsxText'])) {
var value = tokens[tokenIndex].value;
var replacementCode = formatJSXTextReplacement(value);
var literalCode = formatJSXTextLiteral(value);
if (literalCode === '""') {
replaceToken(replacementCode);
}
else {
replaceToken(', ' + literalCode + replacementCode);
}
processChildTextElement();
}

@@ -139,2 +137,13 @@ else {

}
function processChildTextElement() {
var value = tokens[tokenIndex].value;
var replacementCode = formatJSXTextReplacement(value);
var literalCode = formatJSXTextLiteral(value);
if (literalCode === '""') {
replaceToken(replacementCode);
}
else {
replaceToken(', ' + literalCode + replacementCode);
}
}
function processJSXTag() {

@@ -230,1 +239,10 @@ // First tag is always jsxTagStart.

}
/**
* Format a string in the value position of a JSX prop.
*
* Use the same implementation as convertAttribute from
* babel-helper-builder-react-jsx.
*/
function formatJSXStringValueLiteral(text) {
return JSON.stringify(text.replace(/\n\s+/g, " "));
}
{
"name": "sucrase",
"version": "1.1.2",
"version": "1.1.3",
"description": "Super-fast alternative to Babel for when you can target modern JS runtimes",

@@ -5,0 +5,0 @@ "author": "Alan Pierce <alangpierce@gmail.com>",

Sorry, the diff of this file is not supported yet

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