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

@discoveryjs/scan-git

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@discoveryjs/scan-git - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

8

lib/files-methods.d.ts
import { ReadObjectByHash, ReadObjectByOid, ResolveRef, TreeEntry } from './types';
declare type FileEntry = {
type FileEntry = {
path: string;
hash: string;
};
declare type FileDeltaEntry = {
type FileDeltaEntry = {
path: string;
hash: string;
};
declare type FileDelta = {
type FileDelta = {
add: FileDeltaEntry[];

@@ -17,3 +17,3 @@ modify: (FileDeltaEntry & {

};
declare type FilenameEntry<T extends boolean> = T extends true ? FileEntry : string;
type FilenameEntry<T extends boolean> = T extends true ? FileEntry : string;
export declare function createFilesMethods(readObjectByOid: ReadObjectByOid, readObjectByHash: ReadObjectByHash, resolveRef: ResolveRef): {

@@ -20,0 +20,0 @@ treeOidFromRef: (ref: string) => Promise<string>;

@@ -131,3 +131,3 @@ import { join } from 'path';

...sumObjectsStat(stat)
} )
})
)

@@ -134,0 +134,0 @@ ),

@@ -7,4 +7,4 @@ /// <reference types="node" />

import { InternalGitObjectContent, InternalGitObjectHeader, ObjectsTypeStat } from './types.js';
export declare type ReadObjectHeaderFromAllPacks = (hash: Buffer) => Promise<InternalGitObjectHeader | null> | null;
export declare type ReadObjectFromAllPacks = (hash: Buffer, cache?: boolean) => Promise<InternalGitObjectContent | null> | null;
export type ReadObjectHeaderFromAllPacks = (hash: Buffer) => Promise<InternalGitObjectHeader | null> | null;
export type ReadObjectFromAllPacks = (hash: Buffer, cache?: boolean) => Promise<InternalGitObjectContent | null> | null;
export declare class PackContent {

@@ -11,0 +11,0 @@ filename: string;

@@ -22,3 +22,6 @@ import { existsSync, promises } from 'fs';

) {this.filename = filename;this.packSize = packSize;this.index = index;this.reverseIndex = reverseIndex;
this.filesize = this.filename !== null ? reverseIndex.byteLength + 12 + 20 : 0;
this.filesize =
this.filename !== null
? reverseIndex.byteLength + 12 + 20 + 20 // + header + checksum of the corresponding packfile + checksum of the index file
: 0;
}

@@ -55,3 +58,3 @@

try {
const packSize = packFilesize - 20; // 20bytes for trailer
const packSize = packFilesize - 20; // 20bytes for trailer (checksum)

@@ -76,3 +79,3 @@ // https://git-scm.com/docs/pack-format#_pack_rev_files_have_the_format

buffer.byteOffset + 12,
buffer.byteLength - 12
packIndex.size
);

@@ -79,0 +82,0 @@

/// <reference types="node" />
import type { createLooseObjectIndex } from './loose-object-index.js';
import type { createPackedObjectIndex } from './packed-object-index.js';
export declare type InternalReadObject = (hash: Buffer) => Promise<InternalGitObjectContent | null>;
export declare type InternalReadObjectHeader = (hash: Buffer) => Promise<InternalGitObjectHeader | null>;
export declare type ReadObjectByOid = (oid: string) => Promise<InternalGitObjectContent>;
export declare type ReadObjectByHash = (hash: Buffer) => Promise<InternalGitObjectContent>;
export declare type ResolveRef = (ref: string) => Promise<string>;
export declare type LooseObjectIndex = Awaited<ReturnType<typeof createLooseObjectIndex>>;
export declare type PackedObjectIndex = Awaited<ReturnType<typeof createPackedObjectIndex>>;
export declare type PackedObjectType = 'invalid' | 'commit' | 'tree' | 'blob' | 'reserved' | 'tag' | 'ofs_delta' | 'ref_delta';
export declare type CommitObject = {
export type InternalReadObject = (hash: Buffer) => Promise<InternalGitObjectContent | null>;
export type InternalReadObjectHeader = (hash: Buffer) => Promise<InternalGitObjectHeader | null>;
export type ReadObjectByOid = (oid: string) => Promise<InternalGitObjectContent>;
export type ReadObjectByHash = (hash: Buffer) => Promise<InternalGitObjectContent>;
export type ResolveRef = (ref: string) => Promise<string>;
export type LooseObjectIndex = Awaited<ReturnType<typeof createLooseObjectIndex>>;
export type PackedObjectIndex = Awaited<ReturnType<typeof createPackedObjectIndex>>;
export type PackedObjectType = 'invalid' | 'commit' | 'tree' | 'blob' | 'reserved' | 'tag' | 'ofs_delta' | 'ref_delta';
export type CommitObject = {
type: 'commit';
};
export declare type TagObject = {
export type TagObject = {
type: 'tag';
};
export declare type TreeObject = {
export type TreeObject = {
type: 'tree';
};
export declare type BlobObject = {
export type BlobObject = {
type: 'blob';
};
export declare type GitObject = CommitObject | TagObject | TreeObject | BlobObject;
export declare type InternalGitObjectHeader = {
export type GitObject = CommitObject | TagObject | TreeObject | BlobObject;
export type InternalGitObjectHeader = {
type: GitObject['type'];
length: number;
};
export declare type InternalGitObjectContent = {
export type InternalGitObjectContent = {
type: GitObject['type'];
object: Buffer;
};
export declare type Contributor = {
export type Contributor = {
name: string;

@@ -39,3 +39,3 @@ email: string;

};
export declare type AnnotatedTag = {
export type AnnotatedTag = {
tag: string;

@@ -48,6 +48,6 @@ type: 'blob' | 'tree' | 'commit' | 'tag';

};
export declare type LogCommit = {
export type LogCommit = {
oid: string;
} & Commit;
export declare type Commit = {
export type Commit = {
tree: string;

@@ -60,3 +60,3 @@ parent: string[];

};
export declare type TreeEntryTree = {
export type TreeEntryTree = {
isTree: true;

@@ -66,3 +66,3 @@ path: string;

};
export declare type TreeEntryBlob = {
export type TreeEntryBlob = {
isTree: false;

@@ -72,5 +72,5 @@ path: string;

};
export declare type TreeEntry = TreeEntryTree | TreeEntryBlob;
export declare type Tree = TreeEntry[];
export declare type ObjectsStat = {
export type TreeEntry = TreeEntryTree | TreeEntryBlob;
export type Tree = TreeEntry[];
export type ObjectsStat = {
count: number;

@@ -81,12 +81,12 @@ size: number;

};
export declare type ObjectsStatWithTypes = ObjectsStat & {
export type ObjectsStatWithTypes = ObjectsStat & {
types: ObjectsTypeStat[];
};
export declare type ObjectsTypeStat = {
export type ObjectsTypeStat = {
type: PackedObjectType;
} & ObjectsStat;
declare type Added = 1;
declare type Removed = 2;
declare type Modified = 3;
declare type TreeDiffAdded = {
type Added = 1;
type Removed = 2;
type Modified = 3;
type TreeDiffAdded = {
type: Added;

@@ -97,3 +97,3 @@ isTree: boolean;

};
declare type TreeDiffRemoved = {
type TreeDiffRemoved = {
type: Removed;

@@ -104,3 +104,3 @@ isTree: boolean;

};
declare type TreeDiffModified = {
type TreeDiffModified = {
type: Modified;

@@ -112,5 +112,5 @@ isTree: boolean;

};
export declare type TreeDiffEntry = TreeDiffAdded | TreeDiffRemoved | TreeDiffModified;
export declare type TreeDiff = TreeDiffEntry[];
export declare type CruftPackMode =
export type TreeDiffEntry = TreeDiffAdded | TreeDiffRemoved | TreeDiffModified;
export type TreeDiff = TreeDiffEntry[];
export type CruftPackMode =
/** Processes all packs */

@@ -117,0 +117,0 @@ 'include'

{
"name": "@discoveryjs/scan-git",
"version": "0.1.2",
"version": "0.1.3",
"description": "A tool set for fast and efficient git scanning to capture data with focus on large repos",

@@ -39,15 +39,14 @@ "repository": "discoveryjs/scan-git",

"devDependencies": {
"@types/mocha": "^9.1.1",
"@types/node": "^17.0.38",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"c8": "^7.11.3",
"esbuild": "^0.14.42",
"eslint": "^8.16.0",
"eslint-plugin-prettier": "^4.0.0",
"mocha": "^10.0.0",
"prettier": "^2.6.2",
"rollup": "^2.71.1",
"sucrase": "^3.21.0",
"typescript": "^4.8.3"
"@types/mocha": "^10.0.2",
"@types/node": "^20.8.5",
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"c8": "^8.0.1",
"eslint": "^8.51.0",
"eslint-plugin-prettier": "^5.0.1",
"mocha": "^10.2.0",
"prettier": "^3.0.3",
"rollup": "^4.0.2",
"sucrase": "^3.34.0",
"typescript": "^5.2.2"
},

@@ -60,4 +59,4 @@ "scripts": {

"test": "npm run test:esm && npm run test:cjs",
"test:esm": "mocha lib-test/*.js --reporter ${REPORTER:-progress}",
"test:cjs": "mocha lib-test/*.cjs --reporter ${REPORTER:-progress}",
"test:esm": "mocha lib-test/*.js --reporter progress",
"test:cjs": "mocha lib-test/*.cjs --reporter progress",
"build": "npm run build:transpile",

@@ -64,0 +63,0 @@ "build:transpile": "node scripts/transpile.cjs",

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 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 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 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 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 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

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