watskeburt
Advanced tools
Comparing version 0.11.0 to 0.11.1
// generated by tools/get-version.ts - edits will be overwritten | ||
export const VERSION = "0.11.0"; | ||
export const VERSION = "0.11.1"; |
@@ -1,5 +0,1 @@ | ||
// the security (and unicorn) plugins don't seem to detect named caption | ||
// groups very well - false-flagging below regular expressions to be susceptible | ||
// to redos attacks. | ||
/* eslint-disable unicorn/no-unsafe-regex, security/detect-unsafe-regex */ | ||
import { EOL } from "node:os"; | ||
@@ -20,6 +16,4 @@ const DIFF_NAME_STATUS_LINE_PATTERN = /^(?<changeType>[ACDMRTUXB])(?<similarity>[0-9]{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/; | ||
"!": "ignored", | ||
// X: "unknown" | ||
}; | ||
function changeChar2ChangeType(pChar) { | ||
// eslint-disable-next-line security/detect-object-injection | ||
return CHANGE_CHAR_2_CHANGE_TYPE[pChar] ?? "unknown"; | ||
@@ -26,0 +20,0 @@ } |
@@ -33,5 +33,4 @@ import { extname } from "node:path"; | ||
.filter((pName) => pExtensions.has(extname(pName))) | ||
// .replace(/\./g, "\\\\.") | ||
.join("|"); | ||
return `^(${lChanges})$`; | ||
} |
@@ -10,3 +10,2 @@ import { spawnSync } from "node:child_process"; | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
function throwSpawnError(pError) { | ||
@@ -20,9 +19,5 @@ if (pError.code === "ENOENT") { | ||
} | ||
/** | ||
* @throws {Error} | ||
*/ | ||
function getGitResultSync(pArguments, pErrorMap, pSpawnFunction) { | ||
const lGitResult = pSpawnFunction("git", pArguments, { | ||
cwd: process.cwd(), | ||
// eslint-disable-next-line node/no-process-env | ||
env: process.env, | ||
@@ -41,5 +36,2 @@ }); | ||
} | ||
/** | ||
* @throws {Error} | ||
*/ | ||
export function getStatusShortSync(pSpawnFunction = spawnSync) { | ||
@@ -51,6 +43,2 @@ const lErrorMap = { | ||
} | ||
/** | ||
* | ||
* @throws {Error} | ||
*/ | ||
export function getDiffLinesSync(pOldRevision, pNewRevision, pSpawnFunction = spawnSync) { | ||
@@ -57,0 +45,0 @@ const lErrorMap = { |
@@ -1,2 +0,1 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { spawn } from "node:child_process"; | ||
@@ -11,9 +10,5 @@ function stringifyOutStream(pBufferOrString) { | ||
} | ||
/** | ||
* @throws {Error} | ||
*/ | ||
function getGitResult(pArguments, pErrorMap, pSpawnFunction) { | ||
const lGit = pSpawnFunction("git", pArguments, { | ||
cwd: process.cwd(), | ||
// eslint-disable-next-line node/no-process-env | ||
env: process.env, | ||
@@ -49,5 +44,2 @@ }); | ||
} | ||
/** | ||
* @throws {Error} | ||
*/ | ||
export async function getStatusShort(pSpawnFunction = spawn) { | ||
@@ -60,6 +52,2 @@ const lErrorMap = { | ||
} | ||
/** | ||
* | ||
* @throws {Error} | ||
*/ | ||
export async function getDiffLines(pOldRevision, pNewRevision, pSpawnFunction = spawn) { | ||
@@ -66,0 +54,0 @@ const lErrorMap = { |
@@ -19,3 +19,3 @@ import { convertDiffLines, convertStatusLines, } from "./convert-to-change-object.js"; | ||
getDiffLines(lOldRevision, pNewRevision), | ||
lOptions.trackedOnly ? "" : getStatusShort(), | ||
!lOptions.trackedOnly ? getStatusShort() : "", | ||
]); | ||
@@ -22,0 +22,0 @@ let lChanges = convertDiffLines(lDiffLines); |
{ | ||
"name": "watskeburt", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"description": "List files changed since a git revision", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -38,3 +38,3 @@ # watskeburt | ||
const lChangedFiles = await list("main"); | ||
// or, with the sync interface: | ||
// or with the synchronous interface: | ||
// const lChangedFiles = listSync("main"); | ||
@@ -46,2 +46,3 @@ | ||
const lChangedFiles = await list("v0.6.1", "v0.7.1"); | ||
// or with the synchronous interface: | ||
// const lChangedFiles = listSync("v0.6.1", "v0.7.1"); | ||
@@ -57,4 +58,4 @@ | ||
}); | ||
// or with synchronous code: | ||
// const lChangedFiles = listSynd("main", null, { | ||
// or with the synchronous interface: | ||
// const lChangedFiles = listSync("main", null, { | ||
// trackedOnly: false, // when set to true leaves out files not under revision control | ||
@@ -61,0 +62,0 @@ // outputType: "object", // other options: "json" and "regex" (as used in the CLI) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120
27812
395