Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
"version": "1.0.0",
"description": "Port of diff-match-patch to TypeScript.",
"exports": {
"import": {
"types": "./index.d.ts",
"default": "./diff-match-patch-ts.mjs"
},
"require": {
"types": "./index.d.ts",
"default": "./diff-match-patch-ts.cjs"
".": {
"import": {
"types": "./index.d.ts",
"default": "./diff-match-patch-ts.mjs"
},
"require": {
"types": "./index.d.ts",
"default": "./diff-match-patch-ts.cjs"
}
}
},
"main": "diff-match-patch-ts.cjs",
"module": "diff-match-patch-ts.mjs",
"browser": "diff-match-patch-ts.umd.js",
"types": "index.d.ts",
"main": "./diff-match-patch-ts.cjs",
"module": "./diff-match-patch-ts.mjs",
"browser": "./diff-match-patch-ts.umd.js",
"types": "./index.d.ts",
"scripts": {
"build": "rimraf dist && rollup -c rollup.config.mjs && copyfiles package.json README.md LICENSE.md dist",
"test": "jest",
Expand Down Expand Up @@ -67,7 +69,7 @@
"standard-version": "^9.3.2",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "~5.9.0",
"typescript": "~6.0.3",
"typescript-eslint": "^8.7.0"
},
"config": {
Expand Down
12 changes: 6 additions & 6 deletions src/diff-match-patch.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,9 +781,9 @@ export class DiffMatchPatch {
line = decodeURI(text[textPointer].substring(1));
} catch (_ex) {
// Malformed URI sequence.
// TODO: remove this lint suppression once _ex is added as cause after updating target to es2022
// eslint-disable-next-line preserve-caught-error
throw new Error('Illegal escape in patch_fromText: ' + line);
throw new Error('Illegal escape in patch_fromText: ' + line, {
cause: _ex,
});
}
if (sign === '-') {
// Deletion.
Expand Down Expand Up @@ -1884,9 +1884,9 @@ export class DiffMatchPatch {
diffs[diffsLength++] = [DiffOp.Insert, decodeURI(param)];
} catch (_ex) {
// Malformed URI sequence.
// TODO: remove this lint rule suppression once cause is added and target is es2022.
// eslint-disable-next-line preserve-caught-error
throw new Error('Illegal escape in diff_fromDelta: ' + param);
throw new Error('Illegal escape in diff_fromDelta: ' + param, {
cause: _ex,
});
}
break;
}
Expand Down
11 changes: 6 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"compilerOptions": {
"target": "es6",
"rootDir": "./src",
"target": "es2022",
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"strict": true,
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"lib": ["es6"]
"lib": ["ES2022"]
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
"include": ["src/**/*"]
}
Loading