@sucrase/jest-plugin
Advanced tools
Comparing version 1.0.2 to 2.0.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
5595
66
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@jridgewell/gen-mapping@0.3.8(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcommander@4.1.1(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedpirates@4.0.6(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedsucrase@3.35.0(transitive)
+ Addedts-interface-checker@0.1.13(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)
- Removed@types/mz@0.0.32(transitive)
- Removed@types/node@22.10.2(transitive)
- Removedcommander@2.20.3(transitive)
- Removednode-modules-regexp@1.0.0(transitive)
- Removedpirates@3.0.2(transitive)
- Removedsucrase@1.14.0(transitive)
- Removedtslib@1.14.1(transitive)
- Removedundici-types@6.20.0(transitive)
Updatedsucrase@^3.0.0