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

@sucrase/jest-plugin

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sucrase/jest-plugin - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

CHANGELOG.md

42

dist/index.js

@@ -1,25 +0,21 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const sucrase_1 = require("sucrase");
"use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }Object.defineProperty(exports, "__esModule", {value: true});var _sucrase = require('sucrase');
function getTransforms(filename) {
if (filename.endsWith(".js") || filename.endsWith(".jsx")) {
return ["flow", "jsx", "imports"];
}
else if (filename.endsWith(".ts")) {
return ["typescript", "imports"];
}
else if (filename.endsWith(".tsx")) {
return ["typescript", "jsx", "imports"];
}
return null;
if (filename.endsWith(".js") || filename.endsWith(".jsx")) {
return ["flow", "jsx", "imports"];
} else if (filename.endsWith(".ts")) {
return ["typescript", "imports"];
} else if (filename.endsWith(".tsx")) {
return ["typescript", "jsx", "imports"];
}
return null;
}
function process(src, filename) {
const transforms = getTransforms(filename);
if (transforms !== null) {
return sucrase_1.transform(src, { transforms, filePath: filename });
}
else {
return src;
}
}
exports.process = process;
function process(src, filename) {
const transforms = getTransforms(filename);
if (transforms !== null) {
return (0, _sucrase.transform)(src, {transforms, filePath: filename}).code;
} else {
return src;
}
} exports.process = process;
{
"name": "@sucrase/jest-plugin",
"version": "1.0.2",
"version": "2.0.0",
"description": "Jest plugin for Sucrase",

@@ -10,4 +10,4 @@ "main": "dist/index.js",

"dependencies": {
"sucrase": "^1.12.1"
"sucrase": "^3.0.0"
}
}

@@ -17,3 +17,3 @@ import {Transform, transform} from "sucrase";

if (transforms !== null) {
return transform(src, {transforms, filePath: filename});
return transform(src, {transforms, filePath: filename}).code;
} else {

@@ -20,0 +20,0 @@ return src;

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