New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@travetto/compiler

Package Overview
Dependencies
Maintainers
1
Versions
307
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/compiler - npm Package Compare versions

Comparing version 0.0.35 to 0.0.36

2

package.json

@@ -22,3 +22,3 @@ {

"scripts": {},
"version": "0.0.35"
"version": "0.0.36"
}
import * as ts from 'typescript';
import { EventEmitter } from 'events';
import { AppInfo } from '@travetto/base';
import { AppInfo, AppEnv } from '@travetto/base';
import { TransformerManager } from './transformers';

@@ -26,3 +26,3 @@ import { CompilerUtil } from './util';

constructor(public cwd: string = process.cwd()) {
constructor(public cwd: string = AppEnv.cwd) {

@@ -29,0 +29,0 @@ const exclude = [/\.d\.ts$/g]; // Definition files

@@ -7,4 +7,2 @@ import * as fs from 'fs';

const { cwd, cache } = AppEnv;
const stringHash = require('string-hash');

@@ -17,14 +15,6 @@

constructor(private config: { cache?: boolean, cacheDir?: string } = {}) {
constructor(private config: { cache?: boolean } = {}) {
Object.assign(config, { ... { cache: true }, config });
try {
fs.mkdirSync(this.config.cacheDir!);
} catch (e) { }
}
private resolveCacheName(fileName: string) {
return `${cache.dir}/${fileName.replace(cwd, '').replace(/[\/\\]/g, cache.sep).replace(/.ts$/, '@ts')}`;
}
registerSourceMaps() {

@@ -112,3 +102,3 @@ sourcemap.install({

if (this.config.cache) {
fs.writeFileSync(this.resolveCacheName(name), content);
fs.writeFileSync(AppEnv.cache.toEntryName(name), content);
}

@@ -124,11 +114,11 @@ }

hasCached(file: string) {
return this.config.cache && fs.existsSync(this.resolveCacheName(file));
return this.config.cache && fs.existsSync(AppEnv.cache.toEntryName(file));
}
getCached(file: string) {
return fs.readFileSync(this.resolveCacheName(file)).toString();
return fs.readFileSync(AppEnv.cache.toEntryName(file)).toString();
}
deleteCached(file: string) {
fs.unlinkSync(this.resolveCacheName(file));
fs.unlinkSync(AppEnv.cache.toEntryName(file));
}

@@ -135,0 +125,0 @@

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