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

knip

Package Overview
Dependencies
Maintainers
1
Versions
423
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knip - npm Package Compare versions

Comparing version 5.24.3 to 5.24.4

11

dist/plugins/jest/index.js
import { dirname, isInternal, join, toAbsolute } from '#p/util/path.js';
import { hasDependency, load } from '#p/util/plugin.js';
import { hasDependency, load, resolveEntry } from '#p/util/plugin.js';
import { toEntryPattern } from '#p/util/protocols.js';

@@ -52,4 +52,2 @@ const title = 'Jest';

const watchPlugins = config.watchPlugins?.map(watchPlugin => (typeof watchPlugin === 'string' ? watchPlugin : watchPlugin[0])) ?? [];
const setupFiles = (config.setupFiles ?? []).map(toEntryPattern);
const setupFilesAfterEnv = (config.setupFilesAfterEnv ?? []).map(toEntryPattern);
const transform = config.transform

@@ -64,4 +62,7 @@ ? Object.values(config.transform).map(transform => (typeof transform === 'string' ? transform : transform[0]))

const testSequencer = config.testSequencer ? [config.testSequencer] : [];
const globalSetup = (config.globalSetup ? [config.globalSetup] : []).map(toEntryPattern);
const globalTeardown = (config.globalTeardown ? [config.globalTeardown] : []).map(toEntryPattern);
const resolve = (specifier) => resolveEntry(options, specifier);
const setupFiles = (config.setupFiles ?? []).map(resolve);
const setupFilesAfterEnv = (config.setupFilesAfterEnv ?? []).map(resolve);
const globalSetup = (config.globalSetup ? [config.globalSetup] : []).map(resolve);
const globalTeardown = (config.globalTeardown ? [config.globalTeardown] : []).map(resolve);
return [

@@ -68,0 +69,0 @@ ...presets,

@@ -1,3 +0,3 @@

import { isAbsolute, join, relative } from '#p/util/path.js';
import { hasDependency, tryResolve } from '#p/util/plugin.js';
import { join } from '#p/util/path.js';
import { hasDependency, resolveEntry } from '#p/util/plugin.js';
import { toEntryPattern } from '#p/util/protocols.js';

@@ -10,11 +10,2 @@ import { getEnvPackageName, getExternalReporters } from './helpers.js';

const entry = ['**/*.{bench,test,test-d,spec}.?(c|m)[jt]s?(x)'];
const resolveEntry = (options, rootDir, specifier) => {
const { configFileDir, configFileName } = options;
const resolvedPath = isAbsolute(specifier)
? specifier
: tryResolve(join(configFileDir, rootDir, specifier), join(configFileDir, rootDir, configFileName));
if (resolvedPath)
return toEntryPattern(relative(configFileDir, resolvedPath));
return specifier;
};
const isVitestCoverageCommand = /vitest(.+)--coverage(?:\.enabled(?:=true)?)?/;

@@ -36,4 +27,4 @@ const hasScriptWithCoverage = (scripts) => scripts

const rootDir = testConfig.root ?? '.';
const setupFiles = [testConfig.setupFiles ?? []].flat().map(v => resolveEntry(options, rootDir, v));
const globalSetup = [testConfig.globalSetup ?? []].flat().map(v => resolveEntry(options, rootDir, v));
const setupFiles = [testConfig.setupFiles ?? []].flat().map(specifier => resolveEntry(options, specifier, rootDir));
const globalSetup = [testConfig.globalSetup ?? []].flat().map(specifier => resolveEntry(options, specifier, rootDir));
return [...environments, ...reporters, ...coverage, ...setupFiles, ...globalSetup];

@@ -84,3 +75,3 @@ };

const rootDir = cfg.test?.root ?? '.';
const deps = (typeof entry === 'string' ? [entry] : Object.values(entry)).map(specifier => resolveEntry(options, rootDir, specifier));
const deps = (typeof entry === 'string' ? [entry] : Object.values(entry)).map(specifier => resolveEntry(options, specifier, rootDir));
for (const dependency of deps)

@@ -87,0 +78,0 @@ dependencies.add(dependency);

export { _getDependenciesFromScripts as getDependenciesFromScripts } from '../binaries/index.js';
export { _loadJSON as loadJSON } from './fs.js';
export { _load as load } from './loader.js';
export { _tryResolve as tryResolve } from './require.js';
import type { RawPluginConfiguration } from '../types/config.js';

@@ -40,1 +39,2 @@ import type { Plugin, PluginOptions } from '../types/plugins.js';

}) => string[];
export declare const resolveEntry: (options: PluginOptions, specifier: string, rootDir?: string) => string;
export { _getDependenciesFromScripts as getDependenciesFromScripts } from '../binaries/index.js';
export { _loadJSON as loadJSON } from './fs.js';
export { _load as load } from './loader.js';
export { _tryResolve as tryResolve } from './require.js';
import { arrayify } from './array.js';
import { _load as load } from './loader.js';
import { get } from './object.js';
import { basename } from './path.js';
import { basename, isAbsolute, join, relative } from './path.js';
import { toEntryPattern, toProductionEntryPattern } from './protocols.js';
import { _tryResolve as tryResolve } from './require.js';
export const toCamelCase = (name) => name.toLowerCase().replace(/(-[a-z])/g, group => group.toUpperCase().replace('-', ''));

@@ -92,1 +92,10 @@ export const hasDependency = (dependencies, values) => values.some(value => {

});
export const resolveEntry = (options, specifier, rootDir = '.') => {
const { configFileDir, configFileName } = options;
const resolvedPath = isAbsolute(specifier)
? specifier
: tryResolve(join(configFileDir, rootDir, specifier), join(configFileDir, rootDir, configFileName));
if (resolvedPath)
return toEntryPattern(relative(configFileDir, resolvedPath));
return specifier;
};

@@ -1,1 +0,1 @@

export declare const version = "5.24.3";
export declare const version = "5.24.4";

@@ -1,1 +0,1 @@

export const version = '5.24.3';
export const version = '5.24.4';

@@ -35,3 +35,3 @@ import { CacheConsultant } from './CacheConsultant.js';

negatedWorkspacePatterns: string[];
enabledPluginsMap: Record<"astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "unocss" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "lockfileLint" | "lostPixel" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "simpleGitHooks" | "sizeLimit" | "vercelOg" | "webdriverIo", boolean>;
enabledPluginsMap: Record<"angular" | "astro" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "drizzle" | "eleventy" | "eslint" | "gatsby" | "githubActions" | "graphqlCodegen" | "husky" | "jest" | "lefthook" | "linthtml" | "lintStaged" | "lockfileLint" | "lostPixel" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nodeTestRunner" | "npmPackageJsonLint" | "nx" | "nyc" | "oclif" | "playwright" | "playwrightCt" | "postcss" | "prettier" | "releaseIt" | "remark" | "remix" | "rollup" | "semanticRelease" | "sentry" | "simpleGitHooks" | "sizeLimit" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "unocss" | "vercelOg" | "vite" | "vitest" | "vue" | "webdriverIo" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie", boolean>;
enabledPlugins: PluginName[];

@@ -56,3 +56,3 @@ enabledPluginsInAncestors: string[];

referencedDependencies: ReferencedDependencies;
enabledPlugins: ("astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "unocss" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "lockfileLint" | "lostPixel" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "simpleGitHooks" | "sizeLimit" | "vercelOg" | "webdriverIo")[];
enabledPlugins: ("angular" | "astro" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "drizzle" | "eleventy" | "eslint" | "gatsby" | "githubActions" | "graphqlCodegen" | "husky" | "jest" | "lefthook" | "linthtml" | "lintStaged" | "lockfileLint" | "lostPixel" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nodeTestRunner" | "npmPackageJsonLint" | "nx" | "nyc" | "oclif" | "playwright" | "playwrightCt" | "postcss" | "prettier" | "releaseIt" | "remark" | "remix" | "rollup" | "semanticRelease" | "sentry" | "simpleGitHooks" | "sizeLimit" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "unocss" | "vercelOg" | "vite" | "vitest" | "vue" | "webdriverIo" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie")[];
}>;

@@ -59,0 +59,0 @@ onDispose(): void;

{
"name": "knip",
"version": "5.24.3",
"version": "5.24.4",
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",

@@ -5,0 +5,0 @@ "homepage": "https://knip.dev",

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