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

ts-unused-exports

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-unused-exports - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

0

example/app.ts
import inc from './math';
console.log('two', inc(1));
export function add1(x:number) { return x + 1; }
export default (x:number) => x + 1;

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ "use strict";

20

lib/app.js
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = require("fs");

@@ -6,4 +15,6 @@ var path_1 = require("path");

var analyzer_1 = require("./analyzer");
var loadTsConfig = function (tsconfigPath) {
var tsConfig = JSON.parse(fs_1.readFileSync(tsconfigPath, { encoding: 'utf8' }));
var loadTsConfig = function (tsconfigPath, explicitFiles) {
var rawTsConfig = JSON.parse(fs_1.readFileSync(tsconfigPath, { encoding: 'utf8' }));
var tsConfig = explicitFiles
? __assign({}, rawTsConfig, { files: explicitFiles }) : rawTsConfig;
var files = tsConfig.files, compilerOptions = tsConfig.compilerOptions;

@@ -15,6 +26,5 @@ if (!files)

};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = function (tsconfigPath, files) {
var tsConfig = loadTsConfig(tsconfigPath);
return analyzer_1.default(parser_1.default(path_1.dirname(tsconfigPath), files || tsConfig.files, tsConfig.baseUrl));
var tsConfig = loadTsConfig(tsconfigPath, files);
return analyzer_1.default(parser_1.default(path_1.dirname(tsconfigPath), tsConfig.files, tsConfig.baseUrl));
};

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

"use strict";
{
"name": "ts-unused-exports",
"version": "2.0.0",
"version": "2.0.1",
"description": "ts-unused-exports finds unused exported symbols in your Typescript project",

@@ -5,0 +5,0 @@ "main": "lib/app.js",

@@ -0,0 +0,0 @@ ts-unused-exports

export default function() { return 2; };

@@ -0,0 +0,0 @@ export class a {}; // tslint:disable-line

import five from './index'; // tslint:disable-line
export default 5; // tslint:disable-line
import { a } from 'exports';
import { a } from './exports'; // tslint:disable-line
import { b } from './exports'; // tslint:disable-line
import { c } from './exports'; // tslint:disable-line
import { d } from './exports'; // tslint:disable-line
import def from './export-default-function'; // tslint:disable-line
import def from 'exports'; // tslint:disable-line
import def from './exports'; // tslint:disable-line
export * from './exports'; // tslint:disable-line
import five from './has-index/index'; // tslint:disable-line
import five from './has-index'; // tslint:disable-line
import * as all from './exports'; // tslint:disable-line

@@ -0,0 +0,0 @@ export class a {}; // tslint:disable-line

@@ -0,0 +0,0 @@ const { join } = require('path');

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ import { File, Imports, Analysis } from './types';

@@ -13,7 +13,14 @@ import { readFileSync } from 'fs';

const loadTsConfig = (tsconfigPath:string) => {
const tsConfig:TsConfig = JSON.parse(
const loadTsConfig = (
tsconfigPath:string,
explicitFiles:string[]|undefined
) => {
const rawTsConfig:TsConfig = JSON.parse(
readFileSync(tsconfigPath, { encoding: 'utf8' })
);
const tsConfig = explicitFiles
? { ...rawTsConfig, files: explicitFiles }
: rawTsConfig;
const { files, compilerOptions } = tsConfig;

@@ -35,7 +42,7 @@

export default (tsconfigPath:string, files?:string[]) => {
const tsConfig = loadTsConfig(tsconfigPath);
const tsConfig = loadTsConfig(tsconfigPath, files);
return analyze(
parseFiles(
dirname(tsconfigPath),
files || tsConfig.files,
tsConfig.files,
tsConfig.baseUrl

@@ -42,0 +49,0 @@ )

@@ -0,0 +0,0 @@ import analyzeTsConfig from './app';

@@ -0,0 +0,0 @@ import { readFileSync } from 'fs';

@@ -0,0 +0,0 @@ import { existsSync, readFileSync } from 'fs';

@@ -0,0 +0,0 @@ export interface Imports {

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ {

/// <reference path="globals/node/index.d.ts" />
/// <reference path="modules/ramda/index.d.ts" />

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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