Socket
Socket
Sign inDemoInstall

tsconfck

Package Overview
Dependencies
1
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 3.0.1

10

package.json
{
"name": "tsconfck",
"version": "3.0.0",
"version": "3.0.1",
"description": "A utility to work with tsconfig.json without typescript",

@@ -52,7 +52,7 @@ "license": "MIT",

"@tsconfig/node18": "^18.2.2",
"@vitest/coverage-v8": "^0.34.6",
"esbuild": "^0.19.4",
"@vitest/coverage-v8": "^1.1.1",
"esbuild": "^0.19.11",
"tiny-glob": "^0.2.9",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
"typescript": "^5.3.3",
"vitest": "^1.1.1"
},

@@ -59,0 +59,0 @@ "engines": {

@@ -32,3 +32,15 @@ import path from 'node:path';

if (cache?.hasParseResult(filename)) {
return cache.getParseResult(filename);
const result = await cache.getParseResult(filename);
if (
(result.tsconfig.extends && !result.extended) ||
(result.tsconfig.references && !result.referenced)
) {
const promise = Promise.all([
parseExtends(result, cache),
parseReferences(result, options)
]).then(() => result);
cache.setParseResult(filename, promise);
await promise;
}
return result;
}

@@ -57,7 +69,6 @@ const {

resolve(resolveSolutionTSConfig(filename, result));
return promise;
} catch (e) {
reject(e);
return promise;
}
return promise;
}

@@ -212,14 +223,16 @@

function resolveExtends(extended, from) {
if (extended === '..') {
// see #149
extended = '../tsconfig.json';
}
const req = createRequire(from);
let error;
try {
return createRequire(from).resolve(extended);
return req.resolve(extended);
} catch (e) {
error = e;
}
if (!path.isAbsolute(extended) && !extended.startsWith('./') && !extended.startsWith('../')) {
if (extended[0] !== '.' && !path.isAbsolute(extended)) {
try {
const fallbackExtended = path.join(extended, 'tsconfig.json');
return createRequire(from).resolve(fallbackExtended);
return req.resolve(`${extended}/tsconfig.json`);
} catch (e) {

@@ -226,0 +239,0 @@ error = e;

@@ -46,3 +46,3 @@ declare module 'tsconfck' {

* get cached closest tsconfig for files in dir
* @throws if cached value is an error
* @throws {unknown} if cached value is an error
*/

@@ -56,3 +56,3 @@ getConfigPath(dir: string, configName?: string | undefined): Promise<string | null> | string | null;

* get parsed tsconfig for file
* @throws if cached value is an error
* @throws {unknown} if cached value is an error
*/

@@ -59,0 +59,0 @@ getParseResult(file: string): Promise<T> | T;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc