Socket
Socket
Sign inDemoInstall

tsc-alias

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsc-alias - npm Package Compare versions

Comparing version 1.6.9 to 1.6.10

11

dist/replacers/default.replacer.js

@@ -6,2 +6,11 @@ "use strict";

const utils_1 = require("../utils");
function escapeSpecialChars(str) {
return str.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
function getAliasPrefixRegExp(alias) {
return new RegExp(`(?:^${escapeSpecialChars(alias.prefix)})|(?:\.(js|json)$)`, 'g');
}
function removeAliasPrefix(requiredModule, alias) {
return requiredModule.replace(getAliasPrefixRegExp(alias), '');
}
function replaceImportStatement({ orig, file, config }) {

@@ -25,3 +34,3 @@ var _a, _b;

? normalizePath(absoluteAliasPath)
: normalizePath(`${absoluteAliasPath}/${requiredModule.replace(new RegExp(`(?:^${alias.prefix.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')})|(?:\.js$)`, 'g'), '')}`))) {
: normalizePath(`${absoluteAliasPath}/${removeAliasPrefix(requiredModule, alias)}`))) {
continue;

@@ -28,0 +37,0 @@ }

@@ -17,2 +17,3 @@ "use strict";

(0, fs_1.existsSync)(`${path}.js`) ||
(0, fs_1.existsSync)(`${path}.json`) ||
(0, fs_1.existsSync)(`${path}.jsx`) ||

@@ -19,0 +20,0 @@ (0, fs_1.existsSync)(`${path}.cjs`) ||

2

package.json
{
"name": "tsc-alias",
"version": "1.6.9",
"version": "1.6.10",
"description": "Replace alias paths with relative paths after typescript compilation.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

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