How to use the @ts-tools/transpile.filePathToCacheFileName function in @ts-tools/transpile

To help you get started, we’ve selected a few @ts-tools/transpile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AviVahl / ts-tools / packages / node / src / node-extension.ts View on Github external
retrieveSourceMap(filePath) {
                const cacheFilePath = join(optionsScopedCachePath, filePathToCacheFileName(filePath));
                const cachedOutput = readCacheFileSync(cacheFilePath);
                if (cachedOutput && cachedOutput.mtime === statSync(filePath).mtime.getTime()) {
                    const { sourceMapText, outputText } = cachedOutput;
                    const map = sourceMapText || extractInlineSourceMap(outputText);
                    if (map) {
                        return { map, url: filePath };
                    }
                }
                return null;
            }
        });