Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tsc-hooks

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsc-hooks - npm Package Compare versions

Comparing version 1.1.0-dev.20210821.6 to 1.1.0-dev.20210821.7

19

hooks/copy-files/copy-files.hook.js

@@ -21,16 +21,19 @@ module.exports = {

}
ignore.push(
path.resolve(this.tsconfigDir, this.tsconfig.compilerOptions.outDir),
path.resolve(this.tsconfigDir, `${this.tsconfig.compilerOptions.outDir}/**/*`)
);
const files = include?.reduce((files, file) => this.glob.sync(file, { ignore }), []) || [];
const files = include?.reduce((files, file) => [ ...files, ...this.glob.sync(file, { ignore })], []) || [];
for (const file of files) {
if (file.endsWith('.js') || (!this.tsconfig.compilerOptions?.allowTS && file.endsWith('.ts'))) continue;
const relative = file.replace(path.resolve(file, path.relative(file, this.tsconfigDir)), '').split('/').splice(2).join('/');
const target = path.resolve(this.tsconfigDir, this.tsconfig.compilerOptions.outDir, relative);
const outFile = file.replace(this.tsconfigDir, path.resolve(this.tsconfigDir, this.tsconfig.compilerOptions.outDir));
if (!fs.existsSync(path.dirname(target))) {
fs.mkdirSync(path.dirname(target), { recursive: true });
if (!fs.existsSync(path.dirname(outFile))) {
fs.mkdirSync(path.dirname(outFile), { recursive: true });
}
if (fs.lstatSync(file).isDirectory() && !fs.existsSync(target)) {
fs.mkdirSync(target, { recursive: true });
if (fs.lstatSync(file).isDirectory() && !fs.existsSync(outFile)) {
fs.mkdirSync(outFile, { recursive: true });
}

@@ -40,3 +43,3 @@

const fileContent = fs.readFileSync(file);
fs.writeFileSync(path.resolve(target, path.basename(file)), fileContent);
fs.writeFileSync(outFile, fileContent);
}

@@ -43,0 +46,0 @@ }

{
"name": "tsc-hooks",
"version": "1.1.0-dev.20210821.6",
"version": "1.1.0-dev.20210821.7",
"description": "Add tsc compiler hooks to your TypeScript project",

@@ -5,0 +5,0 @@ "main": "run.js",

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