From 1564f73fdb9030119bf1dde89d02acaba39b0b02 Mon Sep 17 00:00:00 2001 From: Florent Klein Date: Tue, 13 Aug 2024 17:41:24 +0200 Subject: [PATCH] fixed file paths usage --- package-lock.json | 4 ++-- src/common/isFileOnPath.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a168dc7..f5afc45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "typescript-strict-plugin", - "version": "2.4.3", + "version": "2.4.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "typescript-strict-plugin", - "version": "2.4.3", + "version": "2.4.4", "license": "MIT", "dependencies": { "chalk": "^3.0.0", diff --git a/src/common/isFileOnPath.ts b/src/common/isFileOnPath.ts index 5db446c..fc5a66a 100644 --- a/src/common/isFileOnPath.ts +++ b/src/common/isFileOnPath.ts @@ -20,7 +20,9 @@ export function isFileOnPath({ const absolutePathToStrictFiles = getAbsolutePath(projectPath, targetPath); - return getPosixFilePath(filePath).startsWith( - getPosixFilePath(absolutePathToStrictFiles) + path.posix.sep, + const posixFilePath = getPosixFilePath(filePath); + const posixStrictPath = getPosixFilePath(absolutePathToStrictFiles); + return ( + posixFilePath === posixStrictPath || posixFilePath.startsWith(posixStrictPath + path.posix.sep) ); }