You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-template-literals

Package Overview
Dependencies
Maintainers
4
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.18.9 to 7.21.4-esm

lib/index.js.map

27

lib/index.js

@@ -7,10 +7,6 @@ "use strict";

exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _core = require("@babel/core");
var _default = (0, _helperPluginUtils.declare)((api, options) => {
var _api$assumption, _api$assumption2;
api.assertVersion(7);

@@ -21,3 +17,2 @@ const ignoreToPrimitiveHint = (_api$assumption = api.assumption("ignoreToPrimitiveHint")) != null ? _api$assumption : options.loose;

if (mutableTemplateObject) helperName += "Loose";
function buildConcatCallExpressions(items) {

@@ -27,3 +22,2 @@ let avail = true;

let canBeInserted = _core.types.isLiteral(right);
if (!canBeInserted && avail) {

@@ -33,3 +27,2 @@ canBeInserted = true;

}
if (canBeInserted && _core.types.isCallExpression(left)) {

@@ -39,7 +32,5 @@ left.arguments.push(right);

}
return _core.types.callExpression(_core.types.memberExpression(left, _core.types.identifier("concat")), [right]);
});
}
return {

@@ -58,3 +49,2 @@ name: "transform-template-literals",

let isStringsRawEqual = true;
for (const elem of quasi.quasis) {

@@ -68,3 +58,2 @@ const {

raws.push(_core.types.stringLiteral(raw));
if (raw !== cooked) {

@@ -74,9 +63,6 @@ isStringsRawEqual = false;

}
const helperArgs = [_core.types.arrayExpression(strings)];
if (!isStringsRawEqual) {
helperArgs.push(_core.types.arrayExpression(raws));
}
const tmp = path.scope.generateUidIdentifier("templateObject");

@@ -92,3 +78,2 @@ path.scope.getProgramParent().push({

},
TemplateLiteral(path) {

@@ -98,7 +83,5 @@ if (path.parent.type === "TSLiteralType") {

}
const nodes = [];
const expressions = path.get("expressions");
let index = 0;
for (const elem of path.node.quasis) {

@@ -108,7 +91,5 @@ if (elem.value.cooked) {

}
if (index < expressions.length) {
const expr = expressions[index++];
const node = expr.node;
if (!_core.types.isStringLiteral(node, {

@@ -121,9 +102,6 @@ value: ""

}
if (!_core.types.isStringLiteral(nodes[0]) && !(ignoreToPrimitiveHint && _core.types.isStringLiteral(nodes[1]))) {
nodes.unshift(_core.types.stringLiteral(""));
}
let root = nodes[0];
if (ignoreToPrimitiveHint) {

@@ -136,10 +114,9 @@ for (let i = 1; i < nodes.length; i++) {

}
path.replaceWith(root);
}
}
};
});
exports.default = _default;
exports.default = _default;
//# sourceMappingURL=index.js.map
{
"name": "@babel/plugin-transform-template-literals",
"version": "7.18.9",
"version": "7.21.4-esm",
"description": "Compile ES2015 template literals to ES5",

@@ -16,3 +16,3 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "^7.18.9"
"@babel/helper-plugin-utils": "^7.21.4-esm"
},

@@ -23,7 +23,7 @@ "keywords": [

"peerDependencies": {
"@babel/core": "^7.0.0-0"
"@babel/core": "^7.0.0-0 || 7.21.4-esm"
},
"devDependencies": {
"@babel/core": "^7.18.9",
"@babel/helper-plugin-test-runner": "^7.18.6"
"@babel/core": "^7.21.4-esm",
"@babel/helper-plugin-test-runner": "^7.21.4-esm"
},

@@ -30,0 +30,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-template-literals",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc