Socket
Socket
Sign inDemoInstall

typescript-transform-paths

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-transform-paths - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [2.2.3](https://github.com/LeDDGroup/typescript-transform-paths/compare/v2.2.2...v2.2.3) (2021-02-02)
### Bug Fixes
* Prevent `.json` extension being stripped in output (fixes [#95](https://github.com/LeDDGroup/typescript-transform-paths/issues/95)) ([bcca436](https://github.com/LeDDGroup/typescript-transform-paths/commit/bcca43677d23ddea0a409ec3daff008313d17342))
### [2.2.2](https://github.com/LeDDGroup/typescript-transform-paths/compare/v2.2.1...v2.2.2) (2021-01-11)

@@ -7,0 +14,0 @@

7

dist/utils/general-utils.js

@@ -24,10 +24,9 @@ "use strict";

let res = [".ts", ".d.ts"];
let { allowJs, jsx, resolveJsonModule: allowJson } = options;
const allowJsx = !!jsx && jsx !== typescript_1.default.JsxEmit.None;
allowJs && res.push(".js");
let { allowJs, jsx } = options;
const allowJsx = !!jsx && (jsx !== typescript_1.default.JsxEmit.None);
allowJs && res.push(".js", ".cjs", ".mjs");
allowJsx && res.push(".tsx");
allowJs && allowJsx && res.push(".jsx");
allowJson && res.push(".json");
return res;
}
exports.getImplicitExtensions = getImplicitExtensions;

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

/* ****************************************************************************************************************** */
const explicitExtensions = [".js", ".jsx"];
const explicitExtensions = [".js", ".jsx", ".cjs", ".mjs"];
// endregion

@@ -93,6 +93,6 @@ /* ****************************************************************************************************************** */

if (extension && implicitExtensions.includes(extension))
filePath = filePath.slice(0, -extension.length) + maybeGetExplicitJsExtension(filePath, extension);
filePath = filePath.slice(0, -extension.length) + maybeGetExplicitExtension(filePath, extension);
return filePath[0] === "." || general_utils_1.isURL(filePath) ? filePath : `./${filePath}`;
}
function maybeGetExplicitJsExtension(filePath, resolvedExtension) {
function maybeGetExplicitExtension(filePath, resolvedExtension) {
const moduleExtension = path_1.default.extname(moduleName);

@@ -99,0 +99,0 @@ if (moduleExtension && !explicitExtensions.includes(moduleExtension))

{
"name": "typescript-transform-paths",
"version": "2.2.2",
"version": "2.2.3",
"description": "Transforms module resolution paths using TypeScript path mapping",

@@ -5,0 +5,0 @@ "keywords": [

@@ -121,3 +121,2 @@ # typescript-transform-paths

"transform": "typescript-transform-paths",
"useRootDirs": true,
"exclude": [ "**/node_modules/**" ]

@@ -155,3 +154,3 @@ }

- [Node Consumable Modules With Typescript Paths](https://medium.com/@ole.ersoy/node-consumable-modules-with-typescript-paths-ed88a5f332fa?postPublishedType=initial) by [oleersoy](https://github.com/oleersoy")
- [Node Consumable Modules With Typescript Paths](https://medium.com/@ole.ersoy/node-consumable-modules-with-typescript-paths-ed88a5f332fa?postPublishedType=initial) by [oleersoy](https://github.com/oleersoy)

@@ -158,0 +157,0 @@ ## Project Guidelines for Contributors

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