@file-services/typescript
Advanced tools
Comparing version 5.4.3 to 5.7.0
@@ -8,2 +8,3 @@ "use strict"; | ||
const typescript_1 = __importDefault(require("typescript")); | ||
const statsNoThrowOptions = { throwIfNoEntry: false }; | ||
const UNIX_NEW_LINE = '\n'; | ||
@@ -78,13 +79,4 @@ const identity = (val) => val; | ||
getScriptVersion(filePath) { | ||
const { stackTraceLimit } = Error; | ||
try { | ||
Error.stackTraceLimit = 0; | ||
return `${statSync(filePath).mtime.getTime()}`; | ||
} | ||
catch { | ||
return `${Date.now()}`; | ||
} | ||
finally { | ||
Error.stackTraceLimit = stackTraceLimit; | ||
} | ||
var _a, _b; | ||
return `${(_b = (_a = statSync(filePath, statsNoThrowOptions)) === null || _a === void 0 ? void 0 : _a.mtime.getTime()) !== null && _b !== void 0 ? _b : Date.now()}`; | ||
}, | ||
@@ -91,0 +83,0 @@ useCaseSensitiveFileNames: caseSensitive, |
{ | ||
"name": "@file-services/typescript", | ||
"description": "Helpers for creation of TypeScript hosts", | ||
"version": "5.4.3", | ||
"version": "5.7.0", | ||
"main": "dist/index.js", | ||
@@ -10,3 +10,3 @@ "peerDependencies": { | ||
"dependencies": { | ||
"@file-services/types": "^5.4.0" | ||
"@file-services/types": "^5.7.0" | ||
}, | ||
@@ -13,0 +13,0 @@ "files": [ |
@@ -13,3 +13,3 @@ # @file-services/typescript | ||
```sh | ||
yarn add @file-services/typescript | ||
npm i @file-services/typescript | ||
``` | ||
@@ -16,0 +16,0 @@ |
import ts from 'typescript'; | ||
import type { IFileSystemSync, IFileSystemPath } from '@file-services/types'; | ||
const statsNoThrowOptions = { throwIfNoEntry: false } as const; | ||
const UNIX_NEW_LINE = '\n'; | ||
@@ -113,11 +114,3 @@ const identity = (val: string) => val; | ||
getScriptVersion(filePath) { | ||
const { stackTraceLimit } = Error; | ||
try { | ||
Error.stackTraceLimit = 0; | ||
return `${statSync(filePath).mtime.getTime()}`; | ||
} catch { | ||
return `${Date.now()}`; | ||
} finally { | ||
Error.stackTraceLimit = stackTraceLimit; | ||
} | ||
return `${statSync(filePath, statsNoThrowOptions)?.mtime.getTime() ?? Date.now()}`; | ||
}, | ||
@@ -124,0 +117,0 @@ useCaseSensitiveFileNames: caseSensitive, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
22870
353
Updated@file-services/types@^5.7.0