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

ts-poet

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-poet - npm Package Compare versions

Comparing version 4.12.0 to 4.13.0

41

build/Import.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +27,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const lodash_1 = __importDefault(require("lodash"));
const path_1 = __importDefault(require("path"));
const path = __importStar(require("path"));
const Node_1 = require("./Node");

@@ -341,13 +360,11 @@ const typeImportMarker = '(?:t:)?';

}
// Drop the `./` prefix from the outputPath if it exists.
const basePath = outputPath.replace(/^.\//, '');
// Ideally we'd use a path library to do all this.
const numberOfDirs = basePath.split('').filter((l) => l === '/').length;
if (numberOfDirs === 0) {
return importPath;
importPath = path.normalize(importPath);
outputPath = path.normalize(outputPath);
const outputPathDir = path.dirname(outputPath);
let relativePath = path.relative(outputPathDir, importPath);
if (!relativePath.startsWith('.')) {
// ensure the js compiler recognizes this is a relative path.
relativePath = './' + relativePath;
}
// Make an array of `..` to get our importPath to the root directory.
const a = new Array(numberOfDirs);
const prefix = a.fill('..', 0, numberOfDirs).join('/');
return prefix + importPath.substring(1);
return relativePath;
}

@@ -357,4 +374,4 @@ exports.maybeRelativePath = maybeRelativePath;

function sameModule(path1, path2) {
return path1 === path2 || path_1.default.resolve(path1) === path_1.default.resolve(path2);
return path1 === path2 || path.resolve(path1) === path.resolve(path2);
}
exports.sameModule = sameModule;
{
"name": "ts-poet",
"version": "4.12.0",
"version": "4.13.0",
"description": "code generation DSL for TypeScript",

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

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