feat: add security sink detection patterns for JavaScript/TypeScript
- Introduced `sink-detect.js` with various security sink detection patterns categorized by type (e.g., command injection, SQL injection, file operations). - Implemented functions to build a lookup map for fast sink detection and to match sink calls against known patterns. - Added `package-lock.json` for dependency management.
This commit is contained in:
@@ -1,10 +1,37 @@
|
||||
namespace StellaOps.Concelier.Merge.Comparers;
|
||||
|
||||
using System.Collections.Immutable;
|
||||
using StellaOps.VersionComparison;
|
||||
|
||||
/// <summary>
|
||||
/// Result of a version comparison with explainability proof lines.
|
||||
/// </summary>
|
||||
/// <param name="Comparison">Negative if left < right, zero if equal, positive if left > right.</param>
|
||||
/// <param name="ProofLines">Human-readable explanation of comparison steps.</param>
|
||||
/// <param name="Comparator">The comparator type used.</param>
|
||||
public sealed record VersionComparisonResult(
|
||||
int Comparison,
|
||||
ImmutableArray<string> ProofLines);
|
||||
ImmutableArray<string> ProofLines,
|
||||
ComparatorType Comparator)
|
||||
{
|
||||
/// <summary>
|
||||
/// True if the left version is less than the right version.
|
||||
/// </summary>
|
||||
public bool IsLessThan => Comparison < 0;
|
||||
|
||||
/// <summary>
|
||||
/// True if the left version equals the right version.
|
||||
/// </summary>
|
||||
public bool IsEqual => Comparison == 0;
|
||||
|
||||
/// <summary>
|
||||
/// True if the left version is greater than the right version.
|
||||
/// </summary>
|
||||
public bool IsGreaterThan => Comparison > 0;
|
||||
|
||||
/// <summary>
|
||||
/// True if the left version is greater than or equal to the right version.
|
||||
/// Useful for checking if installed >= fixed.
|
||||
/// </summary>
|
||||
public bool IsGreaterThanOrEqual => Comparison >= 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user