
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
text-diff-jsx
Advanced tools
component
to be used with React and based on google diff match patch
library.diff-match-patch
: ^1.0.5npm i text-diff-jsx
Component: TextDiff
Name | Type | Required | Description |
---|---|---|---|
originalText | string | Yes | First text to be compared |
modifiedText | string | Yes | Second text to be compared |
format | DiffTableFormat | Optional, default: SideBySide | Possible values: - SideBySide - LineByLine |
hideMatchingLines | boolean | Optional, default: false | Possible values: - true : Only shows lines with differences.- false : shows all lines |
export type DiffTableFormat = 'SideBySide' | 'LineByLine';
export type SideDiff = 'both' | 'left' | 'right';
export interface DiffTableFormatOption {
id: string;
name: string;
label: string;
value: DiffTableFormat;
icon?: string;
disabled?: boolean;
}
export interface DiffPart {
content: string;
isDiff: boolean;
}
export interface DiffLineResult {
lineNumber: number;
prefix: string;
lineContent: string;
lineDiffs: DiffPart[];
}
export interface DiffTableRowResult {
id?: number;
left?: DiffLineResult;
right?: DiffLineResult;
belongTo: SideDiff;
hasDiffs: boolean;
numDiffs: number;
}
export interface ProcessLinesOptions {
id: number;
leftLines: string[];
rightLines: string[];
leftNumber: number;
rightNumber: number;
hasDiffs?: boolean;
}
This project is based on Google Diff Match Patch.
FAQs
A Text Diff component for React.
We found that text-diff-jsx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.