simple-git
Advanced tools
| import { Debugger } from 'debug'; | ||
| declare type OutputLoggingHandler = (message: string, ...args: any[]) => void; | ||
| type OutputLoggingHandler = (message: string, ...args: any[]) => void; | ||
| export interface OutputLogger extends OutputLoggingHandler { | ||
@@ -4,0 +4,0 @@ readonly label: string; |
@@ -1,8 +0,7 @@ | ||
| /// <reference types="node" /> | ||
| import { GitExecutorResult, SimpleGitPluginConfig } from '../types'; | ||
| import { SimpleGitPlugin } from './simple-git-plugin'; | ||
| declare type TaskResult = Omit<GitExecutorResult, 'rejection'>; | ||
| type TaskResult = Omit<GitExecutorResult, 'rejection'>; | ||
| declare function isTaskError(result: TaskResult): boolean; | ||
| export declare function errorDetectionHandler(overwrite?: boolean, isError?: typeof isTaskError, errorMessage?: (result: TaskResult) => Buffer | Error): (error: Buffer | Error | undefined, result: TaskResult) => Error | Buffer | undefined; | ||
| export declare function errorDetectionHandler(overwrite?: boolean, isError?: typeof isTaskError, errorMessage?: (result: TaskResult) => Buffer | Error): (error: Buffer | Error | undefined, result: TaskResult) => Error | Buffer<ArrayBufferLike> | undefined; | ||
| export declare function errorDetectionPlugin(config: SimpleGitPluginConfig['errors']): SimpleGitPlugin<'task.error'>; | ||
| export {}; |
@@ -1,5 +0,4 @@ | ||
| /// <reference types="node" /> | ||
| import { ChildProcess, SpawnOptions } from 'child_process'; | ||
| import { GitExecutorResult } from '../types'; | ||
| declare type SimpleGitTaskPluginContext = { | ||
| type SimpleGitTaskPluginContext = { | ||
| readonly method: string; | ||
@@ -42,3 +41,3 @@ readonly commands: string[]; | ||
| } | ||
| export declare type SimpleGitPluginType = keyof SimpleGitPluginTypes; | ||
| export type SimpleGitPluginType = keyof SimpleGitPluginTypes; | ||
| export interface SimpleGitPlugin<T extends SimpleGitPluginType> { | ||
@@ -45,0 +44,0 @@ action(data: SimpleGitPluginTypes[T]['data'], context: SimpleGitPluginTypes[T]['context']): typeof data; |
@@ -1,4 +0,3 @@ | ||
| /// <reference types="node" /> | ||
| import { SpawnOptions } from 'child_process'; | ||
| import { SimpleGitPlugin } from './simple-git-plugin'; | ||
| export declare function spawnOptionsPlugin(spawnOptions: Partial<SpawnOptions>): SimpleGitPlugin<'spawn.options'>; |
@@ -1,2 +0,2 @@ | ||
| declare type ScheduleCompleteCallback = () => void; | ||
| type ScheduleCompleteCallback = () => void; | ||
| export declare class Scheduler { | ||
@@ -3,0 +3,0 @@ private concurrency; |
| import { SimpleGitTask } from '../types'; | ||
| import { GitError } from '../errors/git-error'; | ||
| import { OutputLogger } from '../git-logger'; | ||
| declare type AnySimpleGitTask = SimpleGitTask<any>; | ||
| declare type TaskInProgress = { | ||
| type AnySimpleGitTask = SimpleGitTask<any>; | ||
| type TaskInProgress = { | ||
| name: string; | ||
@@ -7,0 +7,0 @@ logger: OutputLogger; |
| import { OptionFlags, Options, StringTask } from '../types'; | ||
| export declare type ApplyOptions = Options & OptionFlags<'--stat' | '--numstat' | '--summary' | '--check' | '--index' | '--intent-to-add' | '--3way' | '--apply' | '--no-add' | '-R' | '--reverse' | '--allow-binary-replacement' | '--binary' | '--reject' | '-z' | '--inaccurate-eof' | '--recount' | '--cached' | '--ignore-space-change' | '--ignore-whitespace' | '--verbose' | '--unsafe-paths'> & OptionFlags<'--whitespace', 'nowarn' | 'warn' | 'fix' | 'error' | 'error-all'> & OptionFlags<'--build-fake-ancestor' | '--exclude' | '--include' | '--directory', string> & OptionFlags<'-p' | '-C', number>; | ||
| export type ApplyOptions = Options & OptionFlags<'--stat' | '--numstat' | '--summary' | '--check' | '--index' | '--intent-to-add' | '--3way' | '--apply' | '--no-add' | '-R' | '--reverse' | '--allow-binary-replacement' | '--binary' | '--reject' | '-z' | '--inaccurate-eof' | '--recount' | '--cached' | '--ignore-space-change' | '--ignore-whitespace' | '--verbose' | '--unsafe-paths'> & OptionFlags<'--whitespace', 'nowarn' | 'warn' | 'fix' | 'error' | 'error-all'> & OptionFlags<'--build-fake-ancestor' | '--exclude' | '--include' | '--directory', string> & OptionFlags<'-p' | '-C', number>; | ||
| export declare function applyPatchTask(patches: string[], customArgs: string[]): StringTask<string>; |
@@ -22,5 +22,5 @@ import { CleanSummary } from '../../../typings'; | ||
| */ | ||
| export declare type CleanMode = CleanOptions.FORCE | CleanOptions.DRY_RUN; | ||
| export type CleanMode = CleanOptions.FORCE | CleanOptions.DRY_RUN; | ||
| export declare function cleanWithOptionsTask(mode: CleanMode | string, customArgs: string[]): import("./task").EmptyTask | StringTask<CleanSummary>; | ||
| export declare function cleanTask(mode: CleanMode, customArgs: string[]): StringTask<CleanSummary>; | ||
| export declare function isCleanOptionsArray(input: string[]): input is CleanOptions[]; |
| import { EmptyTask } from './task'; | ||
| import { OptionFlags, Options, StringTask } from '../types'; | ||
| export declare type CloneOptions = Options & OptionFlags<'--bare' | '--dissociate' | '--mirror' | '--no-checkout' | '--no-remote-submodules' | '--no-shallow-submodules' | '--no-single-branch' | '--no-tags' | '--remote-submodules' | '--single-branch' | '--shallow-submodules' | '--verbose'> & OptionFlags<'--depth' | '-j' | '--jobs', number> & OptionFlags<'--branch' | '--origin' | '--recurse-submodules' | '--separate-git-dir' | '--shallow-exclude' | '--shallow-since' | '--template', string>; | ||
| export type CloneOptions = Options & OptionFlags<'--bare' | '--dissociate' | '--mirror' | '--no-checkout' | '--no-remote-submodules' | '--no-shallow-submodules' | '--no-single-branch' | '--no-tags' | '--remote-submodules' | '--single-branch' | '--shallow-submodules' | '--verbose'> & OptionFlags<'--depth' | '-j' | '--jobs', number> & OptionFlags<'--branch' | '--origin' | '--recurse-submodules' | '--separate-git-dir' | '--shallow-exclude' | '--shallow-since' | '--template', string>; | ||
| export declare function cloneTask(repo: string | undefined, directory: string | undefined, customArgs: string[]): StringTask<string> | EmptyTask; | ||
| export declare function cloneMirrorTask(repo: string | undefined, directory: string | undefined, customArgs: string[]): EmptyTask | StringTask<string>; |
@@ -12,3 +12,3 @@ import type { Options, StringTask } from '../types'; | ||
| } | ||
| export declare type LogOptions<T = DefaultLogFields> = { | ||
| export type LogOptions<T = DefaultLogFields> = { | ||
| file?: string; | ||
@@ -15,0 +15,0 @@ format?: T; |
| import { PushResult } from '../../../typings'; | ||
| import { StringTask } from '../types'; | ||
| declare type PushRef = { | ||
| type PushRef = { | ||
| remote?: string; | ||
@@ -5,0 +5,0 @@ branch?: string; |
@@ -9,4 +9,4 @@ import { Maybe, OptionFlags, Options } from '../types'; | ||
| } | ||
| export declare type ResetOptions = Options & OptionFlags<'-q' | '--quiet' | '--no-quiet' | '--pathspec-from-nul'> & OptionFlags<'--pathspec-from-file', string>; | ||
| export type ResetOptions = Options & OptionFlags<'-q' | '--quiet' | '--no-quiet' | '--pathspec-from-nul'> & OptionFlags<'--pathspec-from-file', string>; | ||
| export declare function resetTask(mode: Maybe<ResetMode>, customArgs: string[]): import("../types").StringTask<string>; | ||
| export declare function getResetMode(mode: ResetMode | any): Maybe<ResetMode>; |
| import { LogOptions, LogResult } from '../../../typings'; | ||
| import type { StringTask } from '../types'; | ||
| import type { EmptyTask } from './task'; | ||
| export declare function stashListTask(opt: LogOptions<import("./log").DefaultLogFields> | undefined, customArgs: string[]): EmptyTask | StringTask<LogResult>; | ||
| export declare function stashListTask(opt: LogOptions | undefined, customArgs: string[]): EmptyTask | StringTask<LogResult>; |
| import type { BufferTask, EmptyTaskParser, SimpleGitTask, StringTask } from '../types'; | ||
| export declare const EMPTY_COMMANDS: []; | ||
| export declare type EmptyTask = { | ||
| export type EmptyTask = { | ||
| commands: typeof EMPTY_COMMANDS; | ||
@@ -5,0 +5,0 @@ format: 'empty'; |
@@ -6,3 +6,3 @@ import { GitError } from '../errors/git-error'; | ||
| */ | ||
| export declare type SimpleGitTaskCallback<T = string, E extends GitError = GitError> = (err: E | null, data: T) => void; | ||
| export type SimpleGitTaskCallback<T = string, E extends GitError = GitError> = (err: E | null, data: T) => void; | ||
| /** | ||
@@ -9,0 +9,0 @@ * The event data emitted to the progress handler whenever progress detail is received. |
@@ -1,5 +0,1 @@ | ||
| /// <reference types="node" /> | ||
| /// <reference types="node" /> | ||
| /// <reference types="node" /> | ||
| /// <reference types="node" /> | ||
| import type { SpawnOptions } from 'child_process'; | ||
@@ -16,9 +12,9 @@ import type { SimpleGitTask } from './tasks'; | ||
| */ | ||
| export declare type TaskOptions<O extends Options = Options> = string[] | O; | ||
| export type TaskOptions<O extends Options = Options> = string[] | O; | ||
| /** | ||
| * Options supplied in most tasks as an optional trailing object | ||
| */ | ||
| export declare type OptionsValues = null | string | number; | ||
| export declare type Options = Record<string, OptionsValues>; | ||
| export declare type OptionFlags<FLAGS extends string, VALUE = null> = Partial<Record<FLAGS, VALUE>>; | ||
| export type OptionsValues = null | string | number | (string | number)[]; | ||
| export type Options = Record<string, OptionsValues>; | ||
| export type OptionFlags<FLAGS extends string, VALUE = null> = Partial<Record<FLAGS, VALUE>>; | ||
| /** | ||
@@ -29,7 +25,7 @@ * A function called by the executor immediately after creating a child | ||
| */ | ||
| export declare type outputHandler = (command: string, stdout: NodeJS.ReadableStream, stderr: NodeJS.ReadableStream, args: string[]) => void; | ||
| export type outputHandler = (command: string, stdout: NodeJS.ReadableStream, stderr: NodeJS.ReadableStream, args: string[]) => void; | ||
| /** | ||
| * Environment variables to be passed into the child process. | ||
| */ | ||
| export declare type GitExecutorEnv = NodeJS.ProcessEnv | undefined; | ||
| export type GitExecutorEnv = NodeJS.ProcessEnv | undefined; | ||
| /** | ||
@@ -158,4 +154,4 @@ * Public interface of the Executor | ||
| } | ||
| export declare type Maybe<T> = T | undefined; | ||
| export declare type MaybeArray<T> = T | T[]; | ||
| export declare type Primitives = string | number | boolean; | ||
| export type Maybe<T> = T | undefined; | ||
| export type MaybeArray<T> = T | T[]; | ||
| export type Primitives = string | number | boolean; |
@@ -1,5 +0,4 @@ | ||
| /// <reference types="node" /> | ||
| import { GitExecutorResult, SimpleGitExecutor } from './index'; | ||
| import { EmptyTask } from '../tasks/task'; | ||
| export declare type TaskResponseFormat = Buffer | string; | ||
| export type TaskResponseFormat = Buffer | string; | ||
| export interface TaskParser<INPUT extends TaskResponseFormat, RESPONSE> { | ||
@@ -17,5 +16,5 @@ (stdOut: INPUT, stdErr: INPUT): RESPONSE; | ||
| } | ||
| export declare type StringTask<R> = SimpleGitTaskConfiguration<R, 'utf-8', string>; | ||
| export declare type BufferTask<R> = SimpleGitTaskConfiguration<R, 'buffer', Buffer>; | ||
| export declare type RunnableTask<R> = StringTask<R> | BufferTask<R>; | ||
| export declare type SimpleGitTask<R> = RunnableTask<R> | EmptyTask; | ||
| export type StringTask<R> = SimpleGitTaskConfiguration<R, 'utf-8', string>; | ||
| export type BufferTask<R> = SimpleGitTaskConfiguration<R, 'buffer', Buffer>; | ||
| export type RunnableTask<R> = StringTask<R> | BufferTask<R>; | ||
| export type SimpleGitTask<R> = RunnableTask<R> | EmptyTask; |
@@ -1,2 +0,1 @@ | ||
| /// <reference types="node" /> | ||
| import { TaskResponseFormat } from '../types'; | ||
@@ -3,0 +2,0 @@ export declare class GitOutputStreams<T extends TaskResponseFormat = Buffer> { |
@@ -1,5 +0,6 @@ | ||
| /// <reference types="node" /> | ||
| import { Buffer } from 'node:buffer'; | ||
| import { Maybe } from '../types'; | ||
| type Callable = (...args: unknown[]) => unknown; | ||
| export declare const NULL = "\0"; | ||
| export declare const NOOP: (...args: any[]) => void; | ||
| export declare const NOOP: Callable; | ||
| /** | ||
@@ -9,3 +10,3 @@ * Returns either the source argument when it is a `Function`, or the default | ||
| */ | ||
| export declare function asFunction<T extends () => any>(source: T | any): T; | ||
| export declare function asFunction<T>(source: T | unknown): Callable; | ||
| /** | ||
@@ -23,3 +24,3 @@ * Determines whether the supplied argument is both a function, and is not | ||
| export declare function toLinesWithContent(input?: string, trimmed?: boolean, separator?: string): string[]; | ||
| declare type LineWithContentCallback<T = void> = (line: string) => T; | ||
| type LineWithContentCallback<T = void> = (line: string) => T; | ||
| export declare function forEachLineWithContent<T>(input: string, callback: LineWithContentCallback<T>): T[]; | ||
@@ -26,0 +27,0 @@ export declare function folderExists(path: string): boolean; |
+6
-6
| { | ||
| "name": "simple-git", | ||
| "description": "Simple GIT interface for node.js", | ||
| "version": "3.27.0", | ||
| "version": "3.28.0", | ||
| "author": "Steve King <steve@mydev.co>", | ||
@@ -19,3 +19,3 @@ "contributors": [ | ||
| "@kwsites/promise-deferred": "^1.1.1", | ||
| "debug": "^4.3.5" | ||
| "debug": "^4.4.0" | ||
| }, | ||
@@ -27,8 +27,8 @@ "devDependencies": { | ||
| "@types/jest": "^29.2.2", | ||
| "@types/node": "^22.5.1", | ||
| "esbuild": "^0.14.10", | ||
| "esbuild-node-externals": "^1.4.1", | ||
| "@types/node": "^22.15.30", | ||
| "esbuild": "^0.25.0", | ||
| "esbuild-node-externals": "^1.18.0", | ||
| "jest": "^29.7.0", | ||
| "ts-node": "^10.9.2", | ||
| "typescript": "^5.5.4" | ||
| "typescript": "^5.7.3" | ||
| }, | ||
@@ -35,0 +35,0 @@ "keywords": [ |
+8
-0
@@ -439,2 +439,10 @@ # Simple Git | ||
| When the value of the property is an array of `string`s or `number`s, each element will be | ||
| included as separate `name=value` pairs: | ||
| ```javascript | ||
| // results in 'git log --grep=bug --grep=fix --grep=feature' | ||
| git.log({ '--grep': ['bug', 'fix', 'feature'] }); | ||
| ``` | ||
| ### Options as an Array | ||
@@ -441,0 +449,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
851
0.95%953262
-0.23%12050
-0.51%Updated