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

@snyk/code-client

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snyk/code-client - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

dist/cache.d.ts

4

dist/files.d.ts

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

import * as flatCache from 'flat-cache';
import { Cache } from './cache';
import { ISupportedFiles, IFileInfo } from './interfaces/files.interface';

@@ -16,5 +16,5 @@ export declare function notEmpty<T>(value: T | null | undefined): value is T;

}>;
export declare function getFileInfo(filePath: string, baseDir: string, withContent?: boolean, cache?: flatCache.Cache | null): Promise<IFileInfo | null>;
export declare function getFileInfo(filePath: string, baseDir: string, withContent?: boolean, cache?: Cache | null): Promise<IFileInfo | null>;
export declare function resolveBundleFiles(baseDir: string, bundleMissingFiles: string[]): Promise<IFileInfo[]>;
export declare function resolveBundleFilePath(baseDir: string, bundleFilePath: string): string;
export declare function composeFilePayloads(files: IFileInfo[], bucketSize?: number): Generator<IFileInfo[]>;

@@ -33,3 +33,3 @@ "use strict";

const util_1 = __importDefault(require("util"));
const flatCache = __importStar(require("flat-cache"));
const cache_1 = require("./cache");
const constants_1 = require("./constants");

@@ -155,4 +155,3 @@ const isWindows = nodePath.sep === '\\';

async function* collectBundleFiles(baseDir, paths, supportedFiles, fileIgnores = constants_1.IGNORES_DEFAULT, maxFileSize = constants_1.MAX_PAYLOAD, symlinksEnabled = false) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
const cache = flatCache.load(constants_1.CACHE_KEY, baseDir);
const cache = new cache_1.Cache(constants_1.CACHE_KEY, baseDir);
const files = [];

@@ -195,3 +194,2 @@ const dirs = [];

}
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
cache.save();

@@ -203,3 +201,3 @@ }

let bundleFiles = [];
const cache = flatCache.load(constants_1.CACHE_KEY, baseDir);
const cache = new cache_1.Cache(constants_1.CACHE_KEY, baseDir);
// Filter for supported extensions/files only

@@ -260,7 +258,5 @@ let processingFiles = filterSupportedFiles(files, supportedFiles);

// Try to get hash from cache
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
const cachedData = cache.getKey(filePath);
if (cachedData) {
if (cachedData[0] === fileStats.size && cachedData[1] === fileStats.mtimeMs) {
// eslint-disable-next-line prefer-destructuring
fileHash = cachedData[2];

@@ -277,3 +273,2 @@ }

fileHash = calcHash(fileContent);
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
cache === null || cache === void 0 ? void 0 : cache.setKey(filePath, [fileStats.size, fileStats.mtimeMs, fileHash]);

@@ -298,4 +293,3 @@ }

async function resolveBundleFiles(baseDir, bundleMissingFiles) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
const cache = flatCache.load('.dccache', baseDir);
const cache = new cache_1.Cache('.dccache', baseDir);
const tasks = bundleMissingFiles.map(mf => {

@@ -306,3 +300,2 @@ const filePath = resolveBundleFilePath(baseDir, mf);

const res = (await Promise.all(tasks)).filter(notEmpty);
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
cache.save(true);

@@ -309,0 +302,0 @@ return res;

@@ -39,2 +39,3 @@ {

"@types/node": "^14.6.2",
"@types/write": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^4.0.1",

@@ -52,3 +53,4 @@ "@typescript-eslint/parser": "^4.0.1",

"yalc": "^1.0.0-pre.44",
"jsonschema": "^1.2.11"
"jsonschema": "^1.2.11",
"write": "^2.0.0"
},

@@ -71,7 +73,6 @@ "dependencies": {

"micromatch": "^4.0.2",
"flat-cache": "^3.0.4",
"@types/uuid": "^8.3.0",
"uuid": "^8.3.2"
},
"version": "3.1.2"
"version": "3.1.3"
}

Sorry, the diff of this file is not supported yet

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